how to display empty table to datagrid

Answer Posted / neha

DataTable tbl=new DataTable();
tbl.Columns.Add("ID", typeof(int));
tbl.Columns.Add("Name");

datagridview.DataSource=tbl;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of ADO.NET and XML web services?

596


What are the 3 major types of connection objects in ado.net?

543


How to identify the updated rows in a dataset?

520


What is the difference between ado.net and entity framework?

508


What is the difference in an abstract class and an interface?

515






What is ado.net in vb net?

507


What is disconnected data?

580


How to enable and disable connection pooling?

511


Which control of the BindingNavigator returns the current position within the data source?

732


Define isolation?

535


Which is faster dataset or datareader?

528


Explain the difference between sqlcommand object and command behavior object?

536


What is the difference between a datareader and a dataset?

518


I loaded the dataset with a table of 10 records. One of the records is deleted from the backend, how do you check whether all the 10 records were present while updating the data(which event and steps) and throw the exception 28 can datareader hold data from multiple tables?

553


What is ado.net and its architecture?

501