Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to display empty table to datagrid

Answer Posted / dinesh sharma

DataTable tbl=new DataTable;
DataColumn ID=new
Datacolumn("ID",System.Type.GetType("System.Int"));
DataColumn Name=new
DataColumn("NAME",System.Type.GetType("System.String"));
tbl.Columns.add("ID");
tbl.Columns.Add("NAME");
Datarow dr =null;;
for (int i=0;i<100;i++)
{
dr=tbl.NewRow();
}
datagridview1.datasource=tbl;

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ado.net in mvc?

875


What are the advantages of ado.net?

854


How do you update database through dataset?

940


Which ado.net object is very fast in getting data from the database?

1051


What are the different row versions available in table?

912


Is it possible to load multiple tables in a Dataset?

1003


What are two important objects of ADO.Net?

971


Define bubbled event?

870


Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?

1017


What is the maximum pool size in ado.net connection string?

890


Is datareader faster than datatable?

917


What you mean by filtering of data?

904


What is connection pooling and what is the maximum pool size in ado.net connection string?

902


What are the types of databinding?

933


What is the difference between executenonquery () and executescalar ()?

885