Have a problem with Database

  • Thread starter Thread starter Lian
  • Start date Start date
L

Lian

Hi Everybody

I am reading data from access to dataset and I don't know how to show
it in a text box
this.oleDbConnection1 .Open ();
OleDbCommand cmd=this.oleDbConnection1 .CreateCommand ();
cmd.CommandText ="SELECT * FROM Manufactor ";
this.oleDbDataAdapterManufactor .SelectCommand =cmd ;
this.oleDbDataAdapterManufactor .Fill (this.dsManufactor1 );
this.oleDbConnection1 .Close();
for(int i=0;;i<this.dsManufactor1 .Tables [0].Rows .Count;i++ )
{
if (name=this.dsManufactor1 .Tables [0].Rows [0].ToString ())
{
textbox.text=this.dsManufactor1 .Tables [0].Rows [0].ToString ()
}
}
can some one help me
Liran
 
Liran:

A textbox can only display a single value at a time. You are looping
through all the rows so only the value in the last row will display.

Also, this line:
for(int i=0;;i<this.dsManufactor1 .Tables [0].Rows .Count;i++ )

Has an extra ';'.
 
Back
Top