Nasty2
January 11th, 2006, 11:07 AM
Hey all,
I got a DataSet with 8 DataTables inside..... Filled the DataSet with the following code:
Dim conn As New MySqlConnection
Dim ECNDA As MySqlDataAdapter
Dim tablenames() As String = {"BopOptions", "BomRouting", "ProgramChanges", "StockedParts", "JigTools", "Status", "ChangeCategories", "Originators"}
For i As Integer = 0 To tablenames.GetUpperBound(0)
Dim sql As String = "Select " & tablenames(i) & ".* From " & tablenames(i)
If ConfigurationSettings.AppSettings("CompLocation") = "1" Then
conn.ConnectionString = connStringLocal
End If
If ConfigurationSettings.AppSettings("CompLocation") = "2" Then
conn.ConnectionString = connStringForeign
End If
ECNDA = New MySqlDataAdapter(sql, conn)
Dim myTable As New DataTable(tablenames(i))
ECNDA.Fill(myTable)
COMBOSDS.Tables.Add(myTable)
conn.Close()
Next
It seems to work fine....... this is the right way to do things, right?
How can I insert the changes I have done to one particular Table into the DataBase?
I searched around for an answer, but only got examples using one table in the DataSet.
Thanks
I got a DataSet with 8 DataTables inside..... Filled the DataSet with the following code:
Dim conn As New MySqlConnection
Dim ECNDA As MySqlDataAdapter
Dim tablenames() As String = {"BopOptions", "BomRouting", "ProgramChanges", "StockedParts", "JigTools", "Status", "ChangeCategories", "Originators"}
For i As Integer = 0 To tablenames.GetUpperBound(0)
Dim sql As String = "Select " & tablenames(i) & ".* From " & tablenames(i)
If ConfigurationSettings.AppSettings("CompLocation") = "1" Then
conn.ConnectionString = connStringLocal
End If
If ConfigurationSettings.AppSettings("CompLocation") = "2" Then
conn.ConnectionString = connStringForeign
End If
ECNDA = New MySqlDataAdapter(sql, conn)
Dim myTable As New DataTable(tablenames(i))
ECNDA.Fill(myTable)
COMBOSDS.Tables.Add(myTable)
conn.Close()
Next
It seems to work fine....... this is the right way to do things, right?
How can I insert the changes I have done to one particular Table into the DataBase?
I searched around for an answer, but only got examples using one table in the DataSet.
Thanks