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

Dear Mr. Jhonny.g,

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.