Hi All.
I try configure DataAdapter in VB2005:
and got an error: Select statement problem near ?.Code:SELECT CompName, Name, CustomerID
FROM Customer
WHERE CompName LIKE ?
Printable View
Hi All.
I try configure DataAdapter in VB2005:
and got an error: Select statement problem near ?.Code:SELECT CompName, Name, CustomerID
FROM Customer
WHERE CompName LIKE ?
it looks like improper SQL syntax...
usually its something like
SELECT CompName, Name, CustomerID
FROM Customer
WHERE CompName LIKE '%PC%'
that would find any records where CompName has PC in it
just using a ? doesn't tell the SQL what the CompName is suppsed to be like to match against.
What type of DataAdapter? If it's an OleDbDataAdapter then you can use unnamed parameters like that. If it's an SqlDataAdapter then you must use named parameters, e.g.Code:SELECT CompName, Name, CustomerID FROM Customer WHERE CompName LIKE @CompName