This example shows how to get particular column value from a dataset. Even We can get all values of that particular field using loop construct.
query = "SELECT [EnrollmentNo] FROM [vw_NewAttenInfo]";
SqlDataAdapter adp = new SqlDataAdapter(query,con);
DataSet ds = new DataSet();
adp.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count;i++)
{
…………
…………
string st = ds.Tables[0].Rows[i]["EnrollmentNo"].ToString();
……
……
}
populate gridview using DataSet C#
ReplyDeleteSimple and Sweet gud article
ReplyDeletenice article
ReplyDeletethank very much it works nice article
ReplyDeleteit's working nice....
ReplyDeletefor (int i = 0; i < ds.Tables[0].Rows.Count;i++)
ReplyDeletei want to use [i] instead of [0]
in if condition