- Private Sub frmSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
Dim sql1 As String
-
Dim sql2 As String
-
Dim da1 As SqlDataAdapter
-
Dim da2 As SqlDataAdapter
-
Dim con As SqlConnection
-
Dim ds As New DataSet
-
-
-
con = New SqlConnection(StrCon)
-
con.Open()
-
sql1 = "SELECT dbo.tbl_Case.CaseID, dbo.tbl_Case.CaseIDText, dbo.tbl_Client.FirstName, dbo.tbl_Client.ClientID, dbo.tbl_Client.Role
-
FROM dbo.tbl_Case INNER JOIN
-
dbo.tbl_Client ON dbo.tbl_Case.CaseID = dbo.tbl_Client.CaseID
-
WHERE (dbo.tbl_Client.Role = N'Ini')
-
-
sql2 = ""SELECT dbo.tbl_Case.CaseID, dbo.tbl_Case.CaseIDText, dbo.tbl_Client.FirstName, dbo.tbl_Client.ClientID, dbo.tbl_Client.Role
-
FROM dbo.tbl_Case INNER JOIN
-
dbo.tbl_Client ON dbo.tbl_Case.CaseID = dbo.tbl_Client.CaseID
-
WHERE (dbo.tbl_Client.Role <> N'Ini')
-
-
-
da1 = New SqlDataAdapter(sql1, con)
-
da2 = New SqlDataAdapter(sql2, con)
-
da1.Fill(ds, "Parent")
-
da2.Fill(ds, "Child")
-
Dim DataRelation As New DataRelation("Parent", ds.Tables("Parent").Columns("CaseID"), ds.Tables("Child").Columns("CaseID"))
-
ds.Relations.Add(DataRelation)
-
Dim dv As New DataView(ds.Tables("Parent"))
-
-
dgSearch.DataSource = dv
-
-
-
End Sub
-
Hi all,
This is the code that I have and I need to see parent and child record in my datagridview but I only get the parent table in my datagrid.
what is wrong with my code?
Please help me.
1 1241
I found it.
I was using datagridview instead of datagrid.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Walt Borders |
last post by:
Hi,
My problem: Merging two datasets deletes parent elements, preserves
all children.
I've created two dataSets. Each use the same schema, parent-child
nested tables.
The first dataSet is...
|
by: Ross |
last post by:
ASP.NET Problem:
I have a dataset with a parent table and a child table.
For every row in the parent table there are ~1/2 dozen
corresponding records in the child table. In the ASPX page
I have a...
|
by: Roy |
last post by:
How is it done? BTW, I'm reposting this here, as the datagrid newsgroup
appears functionally comatose...
I have a nested datagrid setup. When one updates the child grid using
edit, it also...
|
by: Skowronek |
last post by:
What is the best method to obtain a data value from a parent datagriditem
from a child datagrid - datagrid footer item command event handler?
Here is the layout of my asp.net controls
...
|
by: Andy |
last post by:
Hello,
I have a datagrid within another datagrid. The innder datagrid
contains a dropdownlist which fires an event as index change
(OnSelectedIndexChanged). I can get the ItemIndex of the...
|
by: Frank |
last post by:
Hello,
I have a dataset with 2 tables and a relation (parent - child). I linked
that ds to a datagrid. Shows everything fine (very little coding for such
functionality!).
But.. in the child row I...
|
by: Richard L Rosenheim |
last post by:
I have a dataset containing a parent table related to a child table. The
child table contains an ID field (which is configured as autonumber in the
datatable), the ID of the parent, plus some...
|
by: Ambica Jain |
last post by:
I have a data grid called Files, which has some columns like FileName, Col1,
Col2, ... , Col8. Then i have a combobox which allows user to select from
Col1 to Col8 and based on this selection, i...
|
by: Iain |
last post by:
Hi All
My apologies for posting this here but the Delphi newsgroup is very
slow.
Using Borland Developer Studio 2006 - creating a C# .net application.
I have a datagrid (id = "Documents")...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |