Suppose I have a datatable like this:
DataTable dt = new DataTable("Woot");
dt.Columns.AddRange(new DataColumn[]{
new DataColumn("ID",typeof(System.Guid)),
new DataColumn("Name",typeof(String))
});
When I try to bind a control to it:
this.txtName.DataBindings.Add("Text", _dtRow, "Name");
I get this exception:
Cannot bind to the property or column Name on the DataSource. Parameter name: dataMember
Any idea why this works on a datatable created by a dataAdapter, but not on a programmaticly created one?