abhinav,
for executing your query,do these steps....
1-first you should connect to your datasource(use SqlConnection objects).
2-make a new SqlCommand object and assign it your select query.(yourCommand.CommandText="select ....";)
3-make a new SqlDataAdapter object(new SqlDataAdapter(yourSqlCommandobject)).
4-make a DataSet object.
5-fill your dataset object through your SqlDataAdapter object(adapter.Fill(ds))
here you don't need again connect to your datasource,dataset object preserves your datasource in memory.
6-access the column you want in your DataSet and assign it to your textbox like something you know
textbox.text=DataSet.Tables[0].rows[number of row][number of column].tostring().(numberofcolumn is 5-7 according to your question)
****here DataSet.Tables[0] is equal to your DataTable object*****(it was the answer of your question)
DataSet object consists of DataTable objects,and also DataTable objects Consists of DataRow and DataColumn objects.....
Hope it was sufficient.
--------------------------------------------
Mehdi.
|