does the order of adding parameters matter when using parameters in .net

string sql = "update mytable set nameField = :nameparm where keyField = 
:keyparam";

updateCMD.CommandText = sql;

with the above update statment

the following order of adding parameters doesn't work in .NET 2.0

updateCMD.Parameters.Add(keyparm);

updateCMD.Parameters.Add(nameparm);

while the following works
updateCMD.Parameters.Add(nameparm);

updateCMD.Parameters.Add(keyparm);



why does index of Parametercollection matters when it is going to be matched 
by name parameter?



what will happen in the following scenario.

"update mytable set nameField = :nameparm

where ( keyField = :keyparam ) or (nameField = :nameParm)";

updateCMD.Parameters.Add(nameparm);

updateCMD.Parameters.Add(keyparm);



using 10.0.1 maintenance release.

thanks in advance

vsv




0
vsv
10/12/2007 10:39:33 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

0 Replies
804 Views

Similar Articles

[PageSpeed] 31

Reply:

Similar Artilces:

how to use parameters in method (filter by parameter)
Hello! I've begin to do a tutorial of this site: Working with Data in ASP.NET 2.0 c#, but in the 3. step I can't make something: In this step I can't add parameterized methods to the TableAdapter. The problem come up when I want to add Sql query. SELECT     ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, DiscontinuedFROM         ProductsWHERE     CategoryID = @CategoryID The error message:  Error in WHERE clause near '@...

Send keyword string with using parameter VB.NET with ASP.NET
Hello, Can someone in this forum section to assist me on how to shorten many keywords as a parameter string after <title> </title>, example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" ><head><title> Realm Of Scotland - Welcome To</title><meta name="KEYWORDS" content="Scotland, the EU, The Highland Clearances, the Union, Land Reform, GERS report, Constitutional issues, Niall Aslen, Declaration of Arbroath, Alastair McInt...

Control Parameters not parametizing...
  Code:<asp:SqlDataSource runat="Server" ID="UserDS" SelectCommand="SELECT DISTINCT [user_id], permission FROM admin_permissions" DeleteCommand="DELETE FROM admin_permissions WHERE [user_id] = @old_user_id AND permission = @old_permission" InsertCommand="INSERT INTO admin_permissions ('user_id','permission') VALUES (@user_id, @permission)" OldValuesParameterFormatString="old_{0}" ConnectionString="<%$ConnectionStrings:HPWCore %>"> <InsertParameters> ...

What is the best parameter to use for a sqldatasource when the parameter is the sqlmembership username?
I know i can accomplish this by setting a session variable on page load on the server side (Session["UserName"]= User.Identity.Name) and then use a session parameter, but I was wondering how to do it without using session variables, i was hoping the following code would work, but it doesn't. Thanks for any ideas. " Name="UserName" Type="String" /> I'd suggest using an expressionbuilder.  It's pretty straight forward.  Here is an example in a post I did. http://peterkellner.net...

How can you use SQL Full Text Search CONTAINS() with an asp.net 2.0 ObjectDataSource using @Parameters?
How can you use SQL Full Text Search CONTAINS() with an asp.net 2.0 ObjectDataSource using @Parameters? MSDN says something like this, but only works directly using like the Query from SQL Manager: USE TestingDB;GODECLARE @SearchWord NVARCHAR(30)SET @SearchWord = N'performance'SELECT TestTextFROM TestingTableWHERE CONTAINS(TestText, @SearchWord); I tryed to mak something like that work with the DataSet DataAdapter Query Builder for the ObjectDataSource, but you can't use DECLARE or SET. SELECT TestTextFROM TestingTableWHERE CONTAINS(TestText, @SearchWord); But again it say...

Using a parameter object for parameter passing b/t windows
The application I am working on is redesigning its base class. Part of their current base class uses an architecture I have not seen before. They have written their own versions of OpenWithParm, OpenSheetWithParm, and CloseWithReturn. These methods store any needed parameters into a nvo, which has room for 7 strings, 1 datawindow, and 1 PowerObject. Their versions of OpenWithParm and OpenSheetWithParm actually do a Open or OpenSheet, respectively. If the opened window needs parameters, it grabs them from this parameter object. The parameter object is then destroyed. CloseWithRe...

Some parameter bindings are missing. Values from the dataset will not be used for those parameters.
I recently added some extra parameters to an insert and updated proc. When I regenerated my database schema via the XSD designer, it gave me the following error during design-time:Some parameter bindings are missing. Values from the dataset will not be used for those parameters.I am not sure what it is. I have double checked my parameters in my procs. Does the order of the parameters matter because everything else looks ok?...

Using parameters in reports in asp.net
Edited by moderator XIII: Please read this article: How to post on forums. Hi I am new in the field  of reporting in asp.net . Please  give me  a  sample  for passing parameters to crystal reports. I am facing problems while setting properties of parameters .thanx,geeta Read this (especially on the PUSH Model)---it is the best way IMO to pass parameters to a crystal reports.  http://aspalliance.com/crystal/redir.aspx?ArticleURL=http://aspalliance.com/215 Also check out this post--  http://forums.asp.net/thread/1239142.aspxMy Regards to All,Jason -- O-H-...

SqlDataSource SelectCommand, parameter order matters?
Hi all, I've been trying to rack my brains over this one; When I use this select statement in SqlDataAdapter, it runs fine; it takes about 4 to 5 seconds to run.  In SqlDataSource, its very erratic; taking between 8 to 71 seconds to run.  I've finally narrowed down the issue to something that resolves the symptoms to something in my query; SELECT     f.UnitID, f.FacilityName, SUM(CASE WHEN t .sData_Type = 'CLINICAL' THEN t .nWrite_Off_Amt ELSE 0 END) AS Sum_Clinical,            &n...

Should I use Session in order to pass parameters
In each of my ASP.NET WebForms I will need to pass two parameters (configuration info) that I will get form the Login screen. I will be passing them to a FormView's SQLDataSource. I was thinking of using the Session in order to pass these parameters (i would prefere these parameters are not shown in the address bar of IE. Is there anything that I should worry about using Sessions, do they take up too much memore, make the server slow down.... Thanks.Peace in ChristMarco Napolihttp://www.ourlovingmother.org Sorry, I misspelled the word Memory.Peace in ChristMarco Napolihttp://www.ourl...

Using stored procedure with parameters gives 'parameter not supplied'
Hi all,I'm using an SqlDataSource to execute a stored procedure in a sybase database, which takes two arguements: create procedure pGetCodes @i_code varchar(32), @i_code_scheme char(8)asbegin select ECM2.code, ECM2.code_scheme, ECM2.source_id, ECM2.stock_exchange_id from refdb_rep..EXTERNAL_CODE_MARKET ECM1 join refdb_rep..EXTERNAL_CODE_MARKET ECM2 on ECM1.instrument_id = ECM2.instrument_id where ECM1.code = @i_code and ECM1.code_scheme = @i_code_scheme order by ECM2.code_schemeendThese arguements are supplied by a textbox and a dropdown as ControlParameters: &...

Passing parameters to SQL SP's using a string not the parameters collection
Hi, I have come up against this for the second time with no answer.... I am trying to pass my SQL parameters the old method...i.e. "sp_CustomersbyID_Get 1" NOT by using the Paramater.add("@CustomerID", integer,8) etc... please see the following code... Public Overloads Function ExecuteDataLayer(ByVal StoredProcedureName As String, ByVal StoredProcedureParams As String) As DataSet Dim ls_Temp As String Try 'this function will serve all Get type of stored procedures.. '--- build the comma...

Using ordered parameters (even if en-US does not)
Hi, While translating central I ran into this bug[1]. There I learned that we can use ordered parameters even if en-US doesn't (and the other way around). Maybe everybody but me already knew that :). But I thought it would not hurt to bring it up here: For example, these two are equivalent for en-US and ab-CD could also use either form: 1. FALLBACK section line %S (%S) prevents caching of line %S (%S) in the %S section. 2. FALLBACK section line %1$S (%2$S) prevents caching of line %3$S (%4$S) in the %5$S section. As a result of that bug, in appcacheutils.properties man...

Problem in Parameter passing using oledb object in .Net
Hi, Anybody please help me in this problem. I am using ASA 9.0 server version now. i try to connect with OLEDB object with ASA DB it is connecting fine but when i try to send the data to the DB thru an Parameter object in OLEDBCommand object. Data saving as junk character in the database. is there any addtional setting has to be made or not. pls tell me the solution for this. If i am using the ASAClient object i am not able to connect only with provider. thru DSN i am able to connect. i want to know ASA connection object only support DSN connection or the Provider also. if yes means...

Web resources about - does the order of adding parameters matter when using parameters in .net - sybase.sqlanywhere.general

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google Webmaster Tools Parameter Handling - Flickr - Photo Sharing!
You aren't signed in Sign In Help Home The Tour Sign Up Explore Explore Home Last 7 Days Interesting Popular Tags Calendar Most Recent Uploads ...

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 12/4/2015 10:15:38 AM