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

What is the purpose of using adodb?

500


What are the uses of Stored Procedure?

551


What is data adapter in ado.net with example?

514


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

642


What are all the different authentication techniques used to connect to MS SQL Server?

538






How to perform sorting on a table in ADO.NET?

553


How to add a javaScript function in a datagrid?

567


What are the parameters that control most of connection pooling behaviours?

571


Which namespaces are used for data access?

621


What is the namespaces being used to access oracle database?

516


What is the use of sqldatareader class?

475


What is the difference between Dataset. clone and Dataset.copy?

555


What are typed and untyped dataset?

554


Explain what are the steps to connect to a database?

491


What is the significance of CommandBehavior.CloseConnection ?

569