User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 403,387 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,535 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 879 | Replies: 1
Reply
Join Date: Feb 2008
Posts: 68
Reputation: johnny.g is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
johnny.g johnny.g is offline Offline
Junior Poster in Training

Help gridview update error

  #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
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
Johnny.G
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Somewhere between heaven and hell
Posts: 94
Reputation: Kusno is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
Kusno's Avatar
Kusno Kusno is offline Offline
Junior Poster in Training

Re: gridview update error

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 9:30 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC