Add query with parameter to tableadapter ?

T

TonyB

I'm trying out the tableadapter in vb.net V2 framework.
I have added a tableadapter which successfully returns all records in a
dataset table. If I preview data by right clicking the dafault
Fill,GetData() methods shown under the TableAdapter this lists all my
records in myTable.
I now want to add a parameter to a query, right click myTableTableAdapter,
and select AddQuery, opening TableAdapter Query Configuration Wizard..
I Next through defaults "Use SQL statements", and "Select which returns
rows", and get to
"Specify a SQL Select Statement", which is preloaded with SELECT t_ID,
t_DateTimeStamp, t_Filename FROM myTable
I want to add a parameter, so I enter WHERE t_Filename=@parameter1 which I
believe specifies that parameter1 is a parameter passed to the query ?
I then clickr Next, and in "Choose Methods to Generate" enter names for the
Fill,Get methods, and then click Next.
Under "Wizard Results" it reports problems configuring query, stating "Error
in WHERE clause near '@' Unable to parse query text".
If I ok anyway the query name is not followed by @parameter1 which should
happen in the examples I've seen on the net. Also if I preview data, the
query fails as No Value given for required parameters, but I cannot enter a
parameter in the parameter table as it is greyed out.
I think I've made an error with the WHERE statement but I cannot find
anything that works ?
Can anyone spot my error ?
 
A

AMDRIT

Are you not connecting to SQL Server? Perhaps you can replace @Paramater1
with ?.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top