Tuesday, April 28, 2009

How to display data in Textboxes using DataSet?

//Populate the DataSet

//Display in TextBoxes using Column Name
TextBox1.Text = ds.Tables [0].Rows[0]["ProductId"].ToString ();
TextBox2.Text =ds.Tables [0].Rows[0]["ProductName"].ToString ();


//Display in TextBoxes using Column Index
TextBox1.Text = ds.Tables [0].Rows[0][0].ToString ();
TextBox2.Text =ds.Tables [0].Rows[0][1].ToString ();

No comments:

Post a Comment