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 the difference between executenonquery () and executescalar ()?

942


Explain the difference between sqlcommand object and command behavior object?

1066


What is the difference between the clone() and copy() methods of the dataset class?

1069


What is the executescalar method?

1080


Which is the best method to get two values from the database?

952


Explain the various objects in dataset.

970


What are the benefits of using ado.net?

993


How to aggregating data across related tables?

1020


What is DataRowCollection?

1086


Define bubbled event?

905


What is basic use of data view?

986


Explain the overview of ado.net architecture?

1017


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

1028


differance between ADO vs ADO.Net?

1037


What is sqldatareader in ado.net?

899