-
Oct 10th, 2021, 08:56 AM
#1
Thread Starter
New Member
bind two table in 1 datagrid
Dim con As New SqlConnection("Data Source=GALIGAO-H\SQLEXPRESS;Initial Catalog=Brgy_Record_Management_Database;User ID=sa;Password=bokies123")
con.Open()
what is wrong in my code?
Dim query As String = "SELECT tblcitezen.fname,tblcitezen.lname,tblhousehold.citezinid,tblhousehold.houseid " &
"FROM tblcitezen INNER Join tblhousehold ON tblcitezen.citezinid = tblhousehold.citezinid"
Dim adapter As New SqlDataAdapter(query, con)
Dim dt As New DataTable
adapter.Fill(dt)
Me.dtg1.DataSource = dt
con.Close()
'dtg1.DataSource = ds.Tables("myTable")
-
Oct 10th, 2021, 09:17 AM
#2
Re: bind two table in 1 datagrid
Maybe you could tell us what actually happens instead of making us guess.
-
Oct 10th, 2021, 05:44 PM
#3
Thread Starter
New Member
Re: bind two table in 1 datagrid
cANT LOAD IN DATAGRIDVIEW..
-
Oct 10th, 2021, 08:07 PM
#4
Re: bind two table in 1 datagrid
That's not an explanation. Explain what actually happens. If you don't know what actually happens then find out. You're not a user. You're the developer so act like it. Use the development tools you have at your disposal and find out what actually happens. There are all sorts of different possibilities. Maybe an exception is thrown when the query is executed. Maybe the query's result set is empty. Maybe something else. You need to make the effort to work what's actually happening and explain it to us. The fact that you can't even see that your Caps Lock key is engaged before submitting a post does fill me with confidence though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|