B
brian
Can you bind a datarelation to a datagrid? I posted my
code below. I built a datarelation with "Users" as
parent and "Computer" as child to create a table
called "Info" in dataset "ds".
I bind my datagrid to the datarelation table "Info" but
the datagrid shows up empty. I debugged the "Info" table
and it shows no records.
The purpose of this is that I need the child table to
display actual text data in the data grid instead of a
number. I can't do a normal query because the two tables
I need are in two different databases.
Thanks for any help!
'Build datareation
Dim drn As DataRelation
Dim dcParent As DataColumn
Dim dcChild As DataColumn
dcParent = ds.Tables("Users").Columns("UserID")
dcChild = ds.Tables("Computer").Columns("c_users")
drn = New DataRelation("Info", dcParent, dcChild)
ds.Relations.Add(drn)
DataGrid1.DataSource = ds.Tables("Info")
DataGrid1.DataBind()
code below. I built a datarelation with "Users" as
parent and "Computer" as child to create a table
called "Info" in dataset "ds".
I bind my datagrid to the datarelation table "Info" but
the datagrid shows up empty. I debugged the "Info" table
and it shows no records.
The purpose of this is that I need the child table to
display actual text data in the data grid instead of a
number. I can't do a normal query because the two tables
I need are in two different databases.
Thanks for any help!
'Build datareation
Dim drn As DataRelation
Dim dcParent As DataColumn
Dim dcChild As DataColumn
dcParent = ds.Tables("Users").Columns("UserID")
dcChild = ds.Tables("Computer").Columns("c_users")
drn = New DataRelation("Info", dcParent, dcChild)
ds.Relations.Add(drn)
DataGrid1.DataSource = ds.Tables("Info")
DataGrid1.DataBind()