473,566 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help on error message from gridview update

why am I getting this error ? ID field is identity, type int
Error message on update
=============== =============
Incorrect syntax near 'nvarchar'.
Must declare the scalar variable "@id".
Datasource
=============== ===
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
....
UpdateCommand= "UPDATE [Properties] SET [PropertyName] = @PropertyName WHERE id = @id" >
<UpdateParamete rs>
<asp:Paramete r Name="ID" Type="Int32"/>
<asp:Paramete r Name="PropertyN ame" Type="String"/>
</UpdateParameter s>
...

Gridview
=============== =
<asp:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"
DataSourceID="S qlDataSource1"
DataKeyNames="i d"
....>
Feb 17 '07 #1
0 1063

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5144
by: Dotnet Gruven | last post by:
I've posted this in the adonet group, however it was suggested I might have better luck here.... ============================================================= I'm trying to use a typed dataset and ObjectDataSource binding to a SQLX db using a foreign key to filter the returned result set to display in a GridView. The error message in the...
0
1242
by: et | last post by:
I set up a gridview to update according to a stored procedure. The parameters in the gridview <UpdateParametersare exactly the same as the parameters in the stored procedure, yet I receive the error "too many arguments". How can I tell what query the gridview update is running?
4
5376
by: scottcly | last post by:
I have a simple editor with a Gridview and a DetailsView. The Gridview handles DELETE and the DetailsView handles UPDATE and ADD. A panel around each one and some minor event handling is used to control which one is visible based on buttons pushed. I can do single operations, but I get an error when I click SELECT on the GRIDVIEW, then UPDATE on...
0
1412
by: Angel | last post by:
I created a Dataset Type on one project which generates a DLL. I have a web project . I created a webpage with a gridview. I attached an ObjectDatasource to the Dataset type from my other project. I assigned the Insert, Update, and select to the ObjectDataSource. I attached the gridview control to the ObjectDataSource. I run it and edit a...
1
541
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
0
834
by: RobertTheProgrammer | last post by:
Hi, This should be ridiculously simple, but I just can't get the update to work in GridView for ASP.NET. Here's the very simplified code: <asp:SqlDataSource id="ProductsSource" Runat="Server" ConnectionString="<%$ ConnectionStrings:ConnectionStringTraining %>" ProviderName="<%$...
0
3616
by: dhyder | last post by:
I'm working on an admin page for a SQL Server 05 db. The page is in ASP.NET 2.0/C#. The db has multiple tables with foreign keys/constraints. I have multiple SqlDataSources and GridViews, which are doing the select/update/delete methods. I manually did the Insert method for each Gridview and I am able perform error handling on it. ...
0
4252
by: steve | last post by:
I have been fighting with trying to update a GridView for a while. I don't want to use the "built-in" way to do it because I am using business layer methods for updating and deleteing and I don't want to have my parameter names in those methods have to be "original_Parametername" or even if I change the OldValuesParameterFormatString to get...
6
4260
by: Ahmedhussain | last post by:
Hi there, I m doing work on a gridview and Im getting an error: A potentially dangerous Request.Form value was detected from the client (ctl00$Content$GridView1$ctl03$TextBox1="<span class='txtColo...") Im using an access database. and when ever I try to update this it doesnt work. <%@ Page Language="C#" MasterPageFile="Mysite.master"...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.