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

How to retrieve the user id which is provided while windows authentication?

1101


What are the benefits of using of ADO.NET in .NET 4.0?

1079


What is ole used for?

944


What are the methods of XML dataset object?

1028


Explain the architecture of ado.net?

1070


How can you add or remove rows from the datatable object of dataset?

1027


What is the difference between data reader and data adapter?

1036


What does executequery return?

979


What is difference between executequery and executeupdate?

1018


What is partial class?

991


How to check if the Dataset has records ?

1008


Which parameter of ConnectionString is used to specify the name of the database?

1061


What are the advantages of ado.net?

915


What are the Features of a dataset

1311


Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.

1021