Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2004, 10:45 AM
Registered User
 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Variables in Select

Can anyone tell what wrong with this code?

 string ROW = Request.QueryString["row_id"]; OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.SelectCommand = new OleDbCommand("select * from S_EVT_ACT WHERE SRA_SR_ID = @ROW", MyConnection);
adapter.Fill(dataSet);

It is passing the values to the dataset and giving an error in Oracle as missing Expression?Any help will be appericated?

Thanks
SEE#YEM

 
Old August 30th, 2004, 02:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

@Row is a parameter, which you have no parameters defined. Define a parameter by adapter.SelectCommand.Parameters.Add("@Row", <data type>, <length>).Value = <value>

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Set multiple variables with one Select? djuricd SQL Server 2000 2 June 14th, 2004 08:08 AM
Select with 3 variables morpheus SQL Server 2000 3 December 5th, 2003 02:59 PM
Passing variables into the SELECT of Stored Proc kerrj SQL Language 1 October 15th, 2003 06:00 AM
Passing variables into the SELECT of Stored Proc kerrj SQL Server 2000 0 October 14th, 2003 10:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.