Filling a typed dataset
-
Hello, I have a typed dataset which I want to display in an ultragrid (infragistics) and display the parent and the children. I can display this ok when I want to display all of the parents and children. But the problem is when user will need to select one parent (by customerID number) from a list and display that parent with its children in the grid. I have created the dataset schema dsAssembliedEquipment.xsd and my 2 tables assembly and AssembiledEquipment. And also created the relationship between them. I have a stored procedure (getDataByCustomerID) that will find the customerID of the assembly (parent) table. This is my code for setting the grid.
'Table Adapter to get the customer ID record Me.TA_Assembly1.GetDataCustomerID(customerID) 'Fill the assembly (parent) table and assembliedEquipment table(child) Me.TA_Assembly1.Fill(Me.DsAssemblyEquipment1.Assembly) Me.TA_AssembliedEquipment1.Fill(Me.DsAssemblyEquipment1.AssembliedEquipment) Me.grdCustomersAssembly.DataMember = "Assembly" Me.grdCustomersAssembly.DataSource = Me.DsAssemblyEquipment1
Code for the stored procedure getDataCustomerID:ALTER PROCEDURE [dbo].[Assembly_SelByCustomerID] ( @CustomerID int ) AS SET NOCOUNT ON; SELECT AssemblyID, CustomerID, AssemblyName FROM dbo.[Assembly] WHERE CustomerID = @CustomerID
I have Assembly (parent) Table fields AssemblyID / customerID / AssemblyName I have child table called AssemblyEquipment (child) fields SerialNo / make / Model / AssemblyID (Foreign Key) Many thanks for any help with this problem, Steve -
Hello, I have a typed dataset which I want to display in an ultragrid (infragistics) and display the parent and the children. I can display this ok when I want to display all of the parents and children. But the problem is when user will need to select one parent (by customerID number) from a list and display that parent with its children in the grid. I have created the dataset schema dsAssembliedEquipment.xsd and my 2 tables assembly and AssembiledEquipment. And also created the relationship between them. I have a stored procedure (getDataByCustomerID) that will find the customerID of the assembly (parent) table. This is my code for setting the grid.
'Table Adapter to get the customer ID record Me.TA_Assembly1.GetDataCustomerID(customerID) 'Fill the assembly (parent) table and assembliedEquipment table(child) Me.TA_Assembly1.Fill(Me.DsAssemblyEquipment1.Assembly) Me.TA_AssembliedEquipment1.Fill(Me.DsAssemblyEquipment1.AssembliedEquipment) Me.grdCustomersAssembly.DataMember = "Assembly" Me.grdCustomersAssembly.DataSource = Me.DsAssemblyEquipment1
Code for the stored procedure getDataCustomerID:ALTER PROCEDURE [dbo].[Assembly_SelByCustomerID] ( @CustomerID int ) AS SET NOCOUNT ON; SELECT AssemblyID, CustomerID, AssemblyName FROM dbo.[Assembly] WHERE CustomerID = @CustomerID
I have Assembly (parent) Table fields AssemblyID / customerID / AssemblyName I have child table called AssemblyEquipment (child) fields SerialNo / make / Model / AssemblyID (Foreign Key) Many thanks for any help with this problem, Steve