I have no problem getting it there in the first place - my problem lies in the fact that I cannot get it to update - I have this code:
Private Sub reloadFieldNames(ByVal tableName)
Dim da As New OleDb.OleDbDataAdapter
Dim oDS As New DataSet
Dim sSQL As String = ""
Dim oConn As New OleDb.OleDbConnection("Provider=SQLOLEDB;Server=.\SQLExpress;Trusted_Connection=Yes;database=" & My.Forms.portfolioGenerator.dbName)
oDS.Reset()
fieldNames.Items.Clear()
Try
oConn.Open()
sSQL = "SELECT fieldName FROM fieldInformation WHERE tableName = '" & tableName & "'"
da = New OleDb.OleDbDataAdapter(sSQL, oConn)
da.Fill(oDS, tableName)
Dim record As DataRow
For Each record In oDS.Tables(tableName).Rows
fieldNames.Items.Add(record.Item("fieldName").ToString)
Next
fieldNames.Refresh()
Catch ex As Exception
MsgBox(ex.ToString & vbCr & vbCr & vbCr & tableName & vbCr & vbCr & sSQL)
Finally
oConn.Close()
End Try
End Sub
And it works just fine - until the user alters a table (which I want to allow) - then it will not show the changes to the table - whether added column or dropped. Any help is appreciated I am not sure why it will not change.