how to display empty table to datagrid

Answer Posted / radhat

This works, but it only provides one empty row.
It doesn't give you 100 empty rows as your code suggests.
To fix this I added:

dr = tbl.Rows.Add();

right underneath the .NewRow(); line

Hope this helps anyone looking for an empty table.

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need ado.net?

543


Explain how to call the sql commands asynchronously in ado.net version 2.0?

508


Does executenonquery return a value?

540


Define the executescalar method?

520


how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?

583






What is ado net stands for?

516


Explain the difference in record set and dataset?

491


What is Data view?

562


What are the Features and disadvantages of dataset

557


What is an ADO.Net?

566


Is ado.net an orm?

518


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

569


What is the difference between typed and untyped dataset?

510


How to read data with the sqldatareader ?

536


What is data relation in ado.net?

517