Re: What is the "@" for?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



hi,

where you got that query from?
I bet it was from a stored procedure, if that is so you cannot use it from
C# and ADO.NET you have to use ? instead
and remember to add the value to the Parameters collection.

google this: "parameterized queries" site:msdn.microsoft.com

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



"Jason Huang" <JasonHuang8888@xxxxxxxxxxx> wrote in message
news:ubA1q2$aFHA.796@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Would someone tell me what's the "@" for in the folloing code?
>
> SqlCommand cmd = new SqlCommand( "SELECT * FROM Products WHERE ProductID
> = @ProductID", con("Server=localhost; DataBase=Northwind; uid=YY;
> password=XXXXXX"));
>
> Thanks a lot.
>
> Jason
>


.



Relevant Pages

  • Q: on stored procedure
    ... In a stored procedure I've a WHERE condition which asks for the following ... When I run the query, the window comes up with D_END and then with D_Start. ... Prev by Date: ...
    (microsoft.public.sqlserver.datamining)
  • Re: optional parameter in sql query
    ... I want to use the td column in the query only if @td variable is ... passed to the stored procedure. ... Thannks ... Prev by Date: ...
    (comp.databases.ms-sqlserver)
  • Help with Stored Procedure Execution Speed - Delphi 6
    ... I call the stored procedure using a TADOQuery passing the ... query because I think I read somewhere that that should help. ... Prev by Date: ...
    (borland.public.delphi.database.ado)
  • Stored Procedure - Obtaining Output
    ... I would like to set up a stored procedure that does the following... ... How to I trap the output of this query! ... Wez ... Prev by Date: ...
    (microsoft.public.sqlserver.mseq)
  • DataSet.WriteXml
    ... I have a stored procedure with a query ... I need my xml looks like this ... Prev by Date: ...
    (microsoft.public.dotnet.framework.adonet)