Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I was wondering if it was possible and how you would take information from a database and store it in an array or variable.

 

I can currently bind a textbox to the database and all. And I can have it keep changing the position of the database and update the textbox to get the data and send it to an array, but is there anyway I can cut out the this method of throwing to a textbox? I've tried using a datareader but can't seem to get it to work right using the Server Explorer access and all. The only thing I could get to work with the datareader command is reading one row of data.

 

Thank for your time,

 

Slyprid

Posted

Yeah i've seen that statement before from searching and tried to impliment it, the only thing is I used this code for the command.

 

Dim MyCommand As New OleDb.OleDbCommand("SELECT * FROM TABLE WHERE ID = 1", OleDbConnection1)
           Dim MyReader As OleDb.OleDbDataReader = MyCommand.ExecuteReader()

 

The problem I ran into with using the loop, is that it doesn't go through whole table. It only grabs whats on ID = 1 . Obviously from looking problem seems to lie in the SQL statement, but i've also tried to use a for loop and a counter in place of the ID =1 ,

 

etc...

for i = 0 to 100
      Dim MyCommand As New OleDb.OleDbCommand("SELECT * FROM TABLE WHERE ID = '" & i & "'", OleDbConnection1)
      mycommand.executereader()
loop

 

Thanks for your time

 

Slipbinary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...