diverdan
Active member
Hi there,
I have managed to find a piece of code that allows me to display 3 datagrids. It works ok when using the northwind example but when I try using my own database I can only display 2 out of the 3 datagrids.
For testing purposes I have used the same table for all 3 grids.
Has anyone had this problem?
This is my code.
Any help would be great!
I have managed to find a piece of code that allows me to display 3 datagrids. It works ok when using the northwind example but when I try using my own database I can only display 2 out of the 3 datagrids.
For testing purposes I have used the same table for all 3 grids.
Has anyone had this problem?
This is my code.
VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] frmCustomers_Load([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]MyBase[/COLOR][/SIZE][SIZE=2].Load
[/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].WindowState = FormWindowState.Maximized
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] conn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlConnection([/SIZE][SIZE=2][COLOR=#800000]"Server = "[/COLOR][/SIZE][SIZE=2] & [/SIZE][SIZE=2][COLOR=#800000]"nx6130"[/COLOR][/SIZE][SIZE=2] & _
[/SIZE][SIZE=2][COLOR=#800000]"; Database = ActionGlass; "[/COLOR][/SIZE][SIZE=2] & _
[/SIZE][SIZE=2][COLOR=#800000]"Integrated Security = sspi;"[/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] ds [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataSet
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] daOrders [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter([/SIZE][SIZE=2][COLOR=#800000]"Select * from tblQuotes"[/COLOR][/SIZE][SIZE=2], conn)
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] daQuotes [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter([/SIZE][SIZE=2][COLOR=#800000]"Select * from tblQuotes"[/COLOR][/SIZE][SIZE=2], conn)
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] daPayments [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlClient.SqlDataAdapter([/SIZE][SIZE=2][COLOR=#800000]"Select * from tblQuotes"[/COLOR][/SIZE][SIZE=2], conn)
daOrders.Fill(ds, [/SIZE][SIZE=2][COLOR=#800000]"tblQuotes"[/COLOR][/SIZE][SIZE=2])
daQuotes.Fill(ds, [/SIZE][SIZE=2][COLOR=#800000]"tblQuotes"[/COLOR][/SIZE][SIZE=2])
daPayments.Fill(ds, [/SIZE][SIZE=2][COLOR=#800000]"tblQuotes"[/COLOR][/SIZE][SIZE=2])
[/SIZE][SIZE=2][COLOR=#008000]'ds.Relations.Add("EmployeeOrder", ds.Tables("Employees").Columns("EmployeeID"), _
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]' ds.Tables("Orders").Columns("EmployeeID"))
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'ds.Relations.Add("Order2Details", ds.Tables("Orders").Columns("OrderID"), _
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]' ds.Tables("OrderDetails").Columns("OrderID"))
[/COLOR][/SIZE][SIZE=2]grdInvoices.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]grdQuotes.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2]grdPayments.ReadOnly = [/SIZE][SIZE=2][COLOR=#0000ff]True
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'grdInvoices.AllowUserToAddRows = False
[/COLOR][/SIZE][SIZE=2]grdInvoices.DataSource = ds
grdQuotes.DataSource = ds
grdPayments.DataSource = ds
grdInvoices.DataMember = [/SIZE][SIZE=2][COLOR=#800000]"tblQuotes"
[/COLOR][/SIZE][SIZE=2]grdQuotes.DataMember = [/SIZE][SIZE=2][COLOR=#800000]"tblQuotes"
[/COLOR][/SIZE][SIZE=2]grdPayments.DataMember = [/SIZE][SIZE=2][COLOR=#800000]"tblQuotes"[/COLOR][/SIZE]
Any help would be great!