|
-
Mar 18th, 2007, 12:08 AM
#1
Thread Starter
Addicted Member
conigure DataAdapter
Hi All.
I try configure DataAdapter in VB2005:
Code:
SELECT CompName, Name, CustomerID
FROM Customer
WHERE CompName LIKE ?
and got an error: Select statement problem near ?.
-
Mar 18th, 2007, 01:19 AM
#2
Re: conigure DataAdapter
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.
-
Mar 18th, 2007, 02:49 AM
#3
Re: conigure DataAdapter
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|