|
I appologize in advance if this question seems simplistic, but I'm fairly new to the whole data access thing.
I have an access database witha query that requires a text parameter. I put it as a query into the tabel adapter for the table it went with and it gave me the error "unable to parse query text." The query work just fine in access, but for some reason VB does not like the PARAMETERS section.
I want a query that requires a paramater (the name of a person) and retireves an integer value for that person in the database so I can store it in a variable.
Basically how do I do this:
PARAMETERS [Person] Text ( 255 ); SELECT [Table].Value FROM [Table] WHERE [Table].Person=[Person];
In Visual Basic
|
|
Hi,
In your tableadapter, just place a " " (without the quotes) to replace your parameter. So your query would look like this:
SELECT [Table].Value FROM [Table] WHERE [Table].Person=
Just use the parameters collection on the tableadapter.SelectCommand object to add you parameter value:
SELECT [Table].Value FROM [Table]
This completely works on SqlServer. Not quite sure on Access...
cheers,
Paul June A. Domag
|