display only single column value in dataset

Sagarp
Posted by Sagarp under ASP.NET category on | Views : 3258
SqlConnection sqlconn = new SqlConnection("Data Source=xxx;Initial Catalog=x_Content;Integrated Security=True");
sqlconn.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from emp ", sqlconn);
DataSet ds = new DataSet();
da.Fill(ds);

DataRow dRow = ds.Tables[0].Rows[0];
TextBox1.Text = dRow.ItemArray.GetValue(0).ToString();


sqlconn.Close();

Comments or Responses

Login to post response