Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi, i want to read data form my database:

 

string SelectQuery="SELECT * FROM datos2 WHERE (numero='"+this.valor+"')";

 

and i want to put the data in textboxs, i did this:

 

if(myreader.Read())

{

this.textBox1.Text=myreader("nombre");

this.comboBox1.Text=myreader("depto");

}

 

but i have some errors like:

 

'myreader' denotes a variable where a metod was expected

 

and i don't know what is the problem, could you help me? please!!!

sorry, my english isn't good...

thanks

Posted

truy changing

 

this.textBox1.Text=myreader("nombre");

this.comboBox1.Text=myreader("depto");

 

to

 

this.textBox1.Text=myreader["nombre"].ToString();

this.comboBox1.Text=myreader["depto"].ToString();

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