PC Review


Reply
Thread Tools Rate Thread

Add query with parameter to tableadapter ?

 
 
TonyB
Guest
Posts: n/a
 
      9th Apr 2007
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 ?


 
Reply With Quote
 
 
 
 
AMDRIT
Guest
Posts: n/a
 
      9th Apr 2007
Are you not connecting to SQL Server? Perhaps you can replace @Paramater1
with ?.


"TonyB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ?
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TableAdapter.Update fails with missing parameter Morris Neuman Microsoft ADO .NET 8 21st May 2008 11:48 AM
TableAdapter IsNull Parameter- Verified Bug - Now What??? Richard Coltrane Microsoft C# .NET 4 4th Jan 2008 10:02 PM
TableAdapter with parameter reidarT Microsoft VB .NET 0 6th Sep 2006 06:30 PM
How to get @Return_Value parameter? It is not generated in TableAdapter.Fill Karel Kral Microsoft ADO .NET 1 21st Jul 2006 03:01 PM
Using 'like' in TableAdapter SQL statement with parameter =?Utf-8?B?Y2xpZmZlaA==?= Microsoft ADO .NET 3 23rd Mar 2006 07:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:05 AM.