QuestionHelpINNER JOIN query in vb.net 2008

Posts 1–5 of 5 · Page 1 of 1
INNER JOIN query in vb.net 2008
I need help with this code..pls tell me whats the correct code for this..

Public Sub Join()

con.open()
dim dt as new DataTable("Table1")
dim rs as new oledb.OledbDataAdapter("Select Table1.clmDate , Table2.clmAMPM from Table1 Inner JOIN Table2 On Table1.ID =
Table2.ID")

rs.fill(dt)
datagridview1.datasource = dt
datagridview1.refresh()
label1.text = dt****ws.count

rs.dispose()

con.close

End Sub
Quote Originally Posted by Joy4hacks View Post
I need help with this code..pls tell me whats the correct code for this..

Public Sub Join()

con.open()
dim dt as new DataTable("Table1")
dim rs as new oledb.OledbDataAdapter("Select Table1.clmDate , Table2.clmAMPM from Table1 Inner JOIN Table2 On Table1.ID =
Table2.ID")

rs.fill(dt)
datagridview1.datasource = dt
datagridview1.refresh()
label1.text = dt****ws.count

rs.dispose()

con.close

End Sub
Well to start I cannot see the entire code. Second what are you wanting it to do exactly? If something is selected from one table it will be selected in another?
.trying to join them..two tables..but i want to only display those specified columns.
Try

Code:
Select t1.clmDate , t2.clmAMPM from Table1 t1 Inner JOIN Table2 t2 On t1.ID = t2.ID
Thanks alot this works ^^.
Quote Originally Posted by Blubb1337 View Post
Try

Code:
Select t1.clmDate , t2.clmAMPM from Table1 t1 Inner JOIN Table2 t2 On t1.ID = t2.ID
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us