Steve,
In VB.NET you would use something like:
Imports System.Data.OleDb
Dim myCmd As OleDbCommand
With MyCmd
.CommandType = CommandType.Text
.CommandText = "SELECT Pub_Name, City, State WHERE City LIKE ?
AND State = ? "
.Parameters.Add("Citywanted", OleDbType.VarChar)
.Parameters.Add("Statewanted", OleDbType.Char)
End With
If you are using the SqlClient, ODBC, Oracle, or other client the code
changes slightly, due to parameters types (OleDbType changes for the type of
client) & possible parameter naming.
The SqlClient does not use the ? placeholders, where as OleDb & ODBC do, I
understand that Oracle does its own thing. Other providers probably do what
ever it is they do (what's "native" for that database).
Check MSDN for the client that you are using for specifics.
Hope this helps
Jay
> Will this VB6 code run in VB.NET:
>
[quoted text clipped - 11 lines]
> And, if so, what would the above code look like?
> Thanks.