gridview update error

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

Join Date: Feb 2008
Posts: 85
Reputation: johnny.g is an unknown quantity at this point 
Solved Threads: 3
johnny.g johnny.g is offline Offline
Junior Poster in Training

gridview update error

 
0
  #1
Feb 27th, 2008
hiii, i am using asp.net 2005 and sql server 2005...i hav a page in which i have used gridview ant sql data source..
i have written the update command for the same..the problem is when i add the where clause in the query i get an error ,,,,here is the code
  1.  
  2. UpdateCommand="UPDATE SMEtre_Master SET FirstName =@FirstName, LastName =@LastName, Type_of_SME =@Type_of_SME, Agency_Name =@Agency_Name, Email =@Email, Address =@Address, Phone =@Phone, Mobile =@Mobile, Fax =@Fax, Experience =@Experience, City =@City, State =@State where SME_Id=@SME_Id"
the error i get is:::
  1.  
  2. Exception Details: System.Data.SqlClient.SqlException: Must declare the scalar variable "@SME_Id".
if i remove the where clause and the i update the whole column gets updated....
can ne1 help me,,,,,hope u understood my prob....pls reply,,its urgent
thnks in advance
Johnny.G
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 175
Reputation: Kusno is an unknown quantity at this point 
Solved Threads: 13
Kusno's Avatar
Kusno Kusno is offline Offline
Junior Poster

Re: gridview update error

 
0
  #2
Feb 27th, 2008
Dear Mr. Jhonny.g,

I think you haven't given input parameter for "@SME_Id"
NEVER NEVER NEVER GIVE UP
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
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