Geeks With Blogs

News



Add to Google

Tim Hibbard CEO for EnGraph software

This seems like common sense now, but I struggled for a couple hours with it today.

When you are binding the DataSource of a System.Windows.Forms.DataGrid to a DataTable that you populate in code, make sure you populate the DataTable.TableName property otherwise it will not bind to the DataGrid.  The TableName can be populated in the DataTable initializer, or by calling the property.

 Dim DT As New Data.DataTable("Mail")
or
 Dim DT As New Data.DataTable
 DT.TableName = "Mail"
 
Technorati Tags: ,
 
Posted on Wednesday, September 14, 2005 3:03 PM .NET | Back to top


Comments on this post: Using code-populated DataTables for DataGrid.DataSource

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Tim Hibbard | Powered by: GeeksWithBlogs.net