Re: how to give value to parameter in a query of dataset in C#.net2005?

ssfftt

Well-known member
Joined
Oct 27, 2005
Messages
163
Programming Experience
1-3
Re: how to give value to parameter in a query of dataset in C#.net2005?

the query is for FillByCNPending is:SELECT ServiceID, ServiceDeliveredDate, CustomerName, FROM [Freedom Scooter Service Reminder]WHERE (CustomerName = '@CNAME')AND (ServiceDeliveredDate IS NULL)my code is:this.TableAdapterCusV.FillByCNPending(this.dataSetCusV.Freedom_Scooter_Service_Reminder,comboBoxCusName.SelectedValue.ToString());when i run the app, it throws error:No overload for method 'FillByCNPending' take '2' argumentsplz help
I use .net2005
 
This is a VB.NET-specific forum. While there is obvious overlap between VB.NET and C# they are not the same. While I would not discourage you from posting your VB.NET questions here, you should direct your C# questions to a C# forum.

As this is more to do with ADO.NET than any specific language I'll answer it this time. Your problem is that you actually don't have any parameters in your query. When specifying a parameter you do not enclose it in single quotes. You query is specifically looking for records where the CustomerName column actually contains the literall value "@CNAME".
 
thx jmcilhinney, Sorry for posting it to the wrong place. because this forum is where I go very often, and get most help from, and also this topic is not really language specific.

I tried to generate query without the single quotes around @CNAME, it gave me this error when i click on "next" button:

General Selected Statement. Error in WHERE clause near "@". Unable to parse query text

could u plz recommand a c#.net forum where u often go to?
 
Back
Top