DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   gridview update error (http://www.daniweb.com/forums/thread111091.html)

johnny.g Feb 27th, 2008 1:34 am
gridview update error
 
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

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:::

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

Kusno Feb 27th, 2008 5:44 am
Re: gridview update error
 
Dear Mr. Jhonny.g,

I think you haven't given input parameter for "@SME_Id"


All times are GMT -4. The time now is 10:28 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC