Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

initialiseDB()

sqlStr = "SELECT * FROM LoginTable"

command = New OleDbCommand()

command.CommandText = sqlStr

command.Connection = conn

reader = command.ExecuteReader()

 

 

my code halts at reader = command.executereader, and the error i get is that i am carrying out an invalid operation

 

the conn value i assign to command.connection is initialised in a function which i call called initialiseDB

 

i do not know why it stops here, can someone help me out?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted
oh yah, one more thing, the function is located in a module, where i declare the conn value as public, so i assume that my form can make use of the conn variable with no problems? am i wrong here? or must i pass back the conn value to the function caller and assign it to a local variable?
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted
You need to make sure the connection is open before executing ExecuteReader(), and I also don't see any place where reader is declared. Oh.. and make sure LoginTable exists in the db that your connection connects to. :)
Gamer extraordinaire. Programmer wannabe.
Posted
oh, i got it, i did not open the connection, thanx a lot!
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...

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...