maintaining relation ships of tables at run time

  • Thread starter Thread starter gaffar
  • Start date Start date
G

gaffar

Hello Sir,

I have created database(ms access) and tables at runtime how to maintain
relation ships between the tables. by using vb.net.

Thanking u sir.
 
Gaffar,

A (old) snippet sample I once made for this.

\\\
Dim Sql As String = "SELECT * from A, B Where " & _
"A.n = B.n"
Dim Conn As New OleDbConnection(connString)
Dim da As New OleDbDataAdapter(Sql, Conn)
da.Fill(ds, "A")
da.Fill(ds, "B")
Conn.Close()
Dim drlA As New DataRelation _
("AA", ds.Tables("A").Columns("A.n"), _
ds.Tables("B").Columns("B.n"))
ds.Relations.Add(drlA)
Dim dv As New DataView(ds.Tables("A"))
DataGrid1.DataSource = ds
DataGrid1.Expand(-1)
////


When this snippet is to short, I have others as well.

I hope this helps,

Cor
 
Back
Top