By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

I want to connect between two columns in two databases

P: 2
I am working on a students attendant project I have created two forms each with database , form1 database contain table that has students information and form2 contain table that has the name of the student and weeks of his attendant , Now i want to connect between the name column in form1 database and the name column in form2 so that whatever is added to form1 database is also added to form2 , please help me !
Jun 21 '14 #1
Share this Question
Share on Google+
1 Reply

P: 2
i have used this code

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source" & "C:\Users\Me\Desktop\meapp\bin\Debug\members.accdb" & ";Jet OLEDB:Database Password=")
  4.         Dim Table_ As String = "Table1"
  5.         Dim query As String = "SELECT * FROM " & Table_
  6.         Dim ds As New DataSet
  8.         conn.Open()
  9.         Dim cmd As New OleDbCommand(query, conn)
  10.         Dim da As New OleDbDataAdapter(cmd)
  11.         conn.Close()
  13.         Dim t1 As DataTable = MembersDataSet.table1
  14.         Dim t2 As DataTable = Form5.WhoishereDataSet.firstmonth
  15.         Dim c1 As DataColumn = MembersDataSet.table1.nameColumn
  16.         Dim c2 As DataColumn = Form5.WhoishereDataSet.firstmonth.nameColumn
  17.         Dim Item(2) As String
  19.         For Each column In t1.Columns
  20.             c1 = c2
  25.         Next
  28.     End Sub
Jun 21 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.