Parameters in SQL help with ASP.NET

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Parameters in SQL help with ASP.NET

 
0
  #1
Oct 8th, 2007
I am trying to alter some SQL to use parameters. I bypassed this earlier as it was just not working but am now heading back to tidy up. For some reason I cannot get this to work, keep in mind I am using Odbc:
  1. SQLString = "SELECT * FROM Stories WHERE StoryID=?"
  2. 'cmdSelectStory.Parameters.Add( "?StoryID", OdbcType.BigInt )
  3. 'cmdSelectStory.Parameters.Add( "?StoryID" ).Value = strStoryID
Anyway I try, I cannot get the parameters to add to the SQL string. In the Odbc database, this column is BigInt(20). I have just been adding it directly into the SQL string, but am now converting that to parameters but cannot figure how. Any help would be appreciated!
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Parameters in SQL help with ASP.NET

 
0
  #2
Oct 8th, 2007
Sorry, after looking at it I realized that I added the parameters before calling it from the command. Therefore, an error arised. fixed.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC