am working on gridview in asp.net c#
SqlConnection con = new SqlConnection(_connString);
SqlDataAdapter da = new SqlDataAdapter("Select * from StudentsInfo",con);
DataSet ds = new DataSet();
Gridview1.datasource = ds.Tables;
Please can u explain me this line
Gridview1.Datasource = ds.Tables;
what do you mean by
Please explain. THANKS.
What does who mean ? Is this a response to an answer, or an article ?
You should consider reading some basic books on C#, because it's clear you don't really understand it well enough to be working in it. ds is a DataSet, as you can see. It has a Tables property. It is an array. The first table in the array has an index of 0. ds.Tables returns the first table in the dataset.
Get familiar with the concept of a
Essentially, a dataset is a collection of datatable objects (each of which could correspond to a table in the database).
When you say
ds.tables, you are accessing the first table in the dataset.
You are then assigning it to the datasource of the GridView.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)