hello,
I have written below code for retreiving the values from database into the textboxes only when I enter id into the textbox.
but it doesn't show any values ino the textboxes.
please tell how it will be done.
da = new SqlDataAdapter( "select * from customers where customerid=" + '" + txtcustid.Text + "' ,conn);
DataSet ds = new DataSet();
da.Fill(ds,"cus tomers");
for(s=0;s<ds.Ta bles[0].Rows.Count ;s++)
{
if( txtcustid.Text= = ds.Tables[0].Rows[s]["customerid "].ToString() )
{
txtcustid.Text =ds.Tables[0].Rows[s] ["customerid "].ToString();
Txtcustname .Text =ds.Tables[0].Rows[s]["contactnam e"].ToString();
Txtdept.Text= ds.Tables[0].Rows[s]["organisati on"].ToString();
}
break;
}
I have written below code for retreiving the values from database into the textboxes only when I enter id into the textbox.
but it doesn't show any values ino the textboxes.
please tell how it will be done.
da = new SqlDataAdapter( "select * from customers where customerid=" + '" + txtcustid.Text + "' ,conn);
DataSet ds = new DataSet();
da.Fill(ds,"cus tomers");
for(s=0;s<ds.Ta bles[0].Rows.Count ;s++)
{
if( txtcustid.Text= = ds.Tables[0].Rows[s]["customerid "].ToString() )
{
txtcustid.Text =ds.Tables[0].Rows[s] ["customerid "].ToString();
Txtcustname .Text =ds.Tables[0].Rows[s]["contactnam e"].ToString();
Txtdept.Text= ds.Tables[0].Rows[s]["organisati on"].ToString();
}
break;
}
Comment