SQL statement - By
Hej EksperterI min database har jeg et felt kaldet By, når jeg så vil hente den i min kode, får jeg fejl.
Dim SQLStr As String = "Select Postnr, By From TestTable"
Er der nogen mulighed for at kunne bruge feltet By ?
Jeg har prøvet med
Dim SQLStr As String = "Select Postnr, [By] From TestTable"
Dog uden held.
Dim cmd As OdbcCommand = New OdbcCommand(SQLStr, connstr)
Dim myDA As New OdbcDataAdapter(cmd)
Dim Builder As OdbcCommandBuilder = New OdbcCommandBuilder(myDA)
Dim myDataSet As DataSet = New DataSet()
myDA.Fill(myDataSet, "MyTable")
DataGridView1.DataSource = myDataSet.Tables("MyTable").DefaultView