The code below works great, and I need it to do more :). It is for vb.net 2008 with access database.
At the moment it matches based on paramValue, and needs an exact match.
How can I change it to look for a pattern instead?? For example I want anything that contains the text "Fizz" and then "Bom".
--And PLEASE share any link where I can learn about this blend of SQL+access+vb.net.
Thank you! Steve
Dim table As New DataTable(tableName)
table.Locale = System.Globalization.CultureInfo.InvariantCulture
Using connection As New OdbcConnection(ConnectionString)
connection.Open()
Dim query As String = String.Format("SELECT * FROM [{0}] WHERE [{1}] = ?", _
tableName, _
paramName)
Dim selectCommand As New OdbcCommand(query, connection)
selectCommand.Parameters.Add(New OdbcParameter("@" & paramName, paramValue))
Dim adapter As New OdbcDataAdapter(selectCommand)
adapter.FillSchema(table, SchemaType.Mapped)
adapter.Fill(table)
End Using
Return table