"Error converting data type nvarchar to numeric."


 Im using the <asp:SqlDataSource to display a table in a datagrid. The data grid has AutoGenerateEditButton="True".

I’m using this update command in the QslDataSource:

UpdateCommand="UPDATE ShoeSize SET US = @US, Eur = @Eur, CM = @CM, Quant = @Quant, id = @id, UK = @UK  FROM ShoeSize WHERE IDroll = @IDroll"

All the cells in the table is decimal(6,1) except ID, quant and IDroll witch are ints.

But when I press update I get this error message:

"Error converting data type nvarchar to numeric."

I understand that I have to convert the fields before the Update commad runs, but I don’t understand how I do this?

Regards Johan

9/15/2006 9:34:20 AM
asp.net.object-datasource 16182 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 29


Similar Artilces:

SQL Server Error: "Arithmetic overflow error converting numeric to data type numeric"
I'm still quite new to SQL, and so I may be missing something quite obvious. Apologies in advance if that's the case. I've included my query at the bottom of the message as it is quite long; my problem is that I get "Arithmetic overflow error converting numeric to data type numeric" when the first parameter to my COALESCE calls is not NULL. That is, the COALESCEs and the query work as I expect when SUM(cust_vw_actual.Actual) is NULL (they return 0.00), but if it isn't I get the error. I am also getting "Warning: Null value eliminated from aggregate.&...

Whan can i do? make "string" data type convert to "window" data type, and use a "window" name to get it ancestor "window name", thanks! i use pb5
Rich, With a string window name, you can open a window of that type if you need to. You could, of course, query that window object for any attributes. Another option is to use the LibraryExport function to export the definition of the window which is specified by the string. You can then parse the resulting file to get information on the ancestor object. HTH Sanjiv. "Rich" <windows_ce@netease.com> wrote in message news:2Xsr1WW0AHA.178@forums.sybase.com... > > > ...

Getting Server Error "Syntax error converting the nvarchar value 'Sonoma' to a column of data type int."
Hi, all I'm getting this error at runtime when my page tries to populate a datagrid. Here's the relevant code. First, the user selects his choice from a dropdownlist, populated with a sqldatasource control on the aspx side:<asp:SqlDataSource ID="sqlDataSourceCompany" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [PayrollCompanyID], [DisplayName] FROM [rsrc_PayrollCompany] ORDER BY [DisplayName]"> </asp:SqlDataSource>  And the dropdown list's code:<asp:DropDownList ID="ddlPayrol...

Error Number 23: cannot assign object of type "x" to variable of type "x"
I am running P/B 7.0.3 Build 10009 against an Oracle 8.0.5 database on Windows NT 4.0 Service Pack 4. I have a PFC application that ran just fine under 6.5.1 but is dying at runtime now with an Error Number 23 (which says you cannot assign an object of type 'x' to variable of type 'x'. There are 2 separate occurrences of this. One involves a window variable and the other involves a tab variable. Right now I am concentrating on the tab control. I have a userobject called tab_control which contains 2 tab pages (tabpg_list and tabpg_detail). In the tabpg_list objec...

Declaring data table "Value of type ..datatable" cannot be converted to "...datatable".
 Hi Guys, The subject of the post clarifies my problem. Do you have any ideas why that is the case? I have done it the same way in a previous project (ok... the difference there was an input paramters for the method) and it worked great.   Thanks,polynaux  Dim dt as LocationsDataTable Dim dr as LocationsDataRow ?  -- "Mark As Answer" if my reply helped you --  hi gunteman, thats how I have done it previously   'Load data into textboxes Dim tPAttribute As New DateSet02_SelectAll_InpusIsATableAdap...

Update error , "Unable to cast object of type 'System.DBNull' to type 'System.String'" , using DataSet as a datasource
Hi All, The following sample code is for testing dw.UpdateData using dataset as the data source. The data retrieval and display part under Form1_Load works fine. However, inputting some values in a new row and calling dw.UpdateData causes the following error: "Unable to cast object of type 'System.DBNull' to type 'System.String'" The error seems to occur when a datawindow column value has been changed from null value. Does anyone know how to fix the error ? Thank you for your advice. I use DW2.5 (build 8542), VS2005 pro, MS SQL Express. ...

Error, "The data types text and nvarchar are incompatible in the equal to operator"
Hi, i have a table in sqlexpress named Contacts: ID   (int)   -primary key- name   (varchar(30)) lastname   (varchar(30)) phone   (varchar(15)) fax   (varchar(15)) desc   (text) In my default.aspx page, i have a GridView that has the conecction to this table. The GridView has the Editing and Deleting checkbox enabled but my problem is that i can't edit or delete any row when the page is running and the massage is this: "The data types text and nvarchar are incompatib...

Converting a type "void" to a type "System.Drawing.Image"
I'm trying to input a thumbnail image in to a a image control.  I keep getting the same error "Cannot implicitly convert type void to type System.Drawing.Image".  I'm coding in C# I've been looking throught object browser to try to find a way to convert the type but it is not working. can anyone help   Hi, could it be that method has incorrect return type? is it your own method raising it? Post some code.Thanks,Teemu KeiskiFinland, EU Here is the code:  The error is commented.  public static bool ThumbNailCallBack() { return false; } public s...

Error:"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
I still don't know what is happening with my application. I used before in another page the formview control and I didn't have the out of range Date error. It was normally. But now, I'm doing everything manually and I don't know why, but I'm with this problem. I need to safe this problem today... Here go my code! The error occurs here: (It's the Sub that Insert data inside of the database(SQLServer)Protected Sub Gravar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim SQL As String = "Update RECEBER SET  EMISSAO = '" & CType(tbDataEmissao.Text, Date) & "', VENCIME...

aspnet_Membership_GetPassword and aspnet_Membership_GetUserByName return "Error converting data type varchar to datetime"
I have an asp:PasswordRecovery control that stopped responding to "Forgot your password". I enter a valid user name (I know it's valid because I used it to login) and press next (this is normally where one gets their password mailed to them) and I get the error "Your attempt to retrieve your password was not successful, please try again". So I fired up SQL profiler and found that the code was calling first aspnet_Membership_GetUserByName() and then aspnet_Membership_GetPassword(). I tried the same calls in SQL Query and I got the error: "Erro...

"data only" "log only" data and log"
i altered the db to include 1 gb. however the fragment was created "data and log". what should have i done to create a 'data only' fragment? melanie wrote: > i altered the db to include 1 gb. > however the fragment was created "data and log". > > what should have i done to create a 'data only' fragment? I believe I'm correct in saying that if your database has data and log on separate devices the alter database command will assume you're adding to "data" unless you specify otherwise by using the "log on&q...

Web Methodst that returns DataTable gives me exception error " "circular reference was detected while serializing an object of type""
Hello, I am getting this error "circular reference was detected while serializing an object of type". The Method GetRecords() is a function that returns DataTable type.. It happens the same thing when i return DataSet as well. Any help? Thanks    function GetStatusRecord() {   // Invoke the Echo method on the server.PageMethods.GetRecords('1', onComplete);  debugger; // Callback function.function onComplete(result) { // Display the echoed string. alert(result); }   return false }   The latest version of Asp.net Ajax no lo...

Error in Data Binding Of Repeater Object of a WebUserControl: "Object reference not set to an instance of an object."
Hi all dudes, I have written the following Code below for Bind a Repeater object in a WebUserControl Object.When I want to set the the DataSource property of Repeater, It encounters the following error:"Object reference not set to an instance of an object."Line 37:     Reader = Cmd.ExecuteReader()Line 38:     Me.Rpt.DataSource = ReaderLine 39:     Me.Rpt.DataBind()When I paste this code in a New WebForm, it doesn't have any problems.So can anyone help me plz ?Thanks in Advance.Public Sub BindRepeater2(ByVal GroupID As String) ...

Problem with "converting the nvarchar value 'xxxxxID' to a column of data type int".
Hi, I have a webform with a drop-down listbox, binded to a table and a GridView, binded to another table. My goal is when I select a value (country in my case) in the drop-down listbox to change what is shown in the GridView, based on the ID that I get from the drop-down listbox. Here is the code (the important parts...): Select a Country : <asp:DropDownList ID="CountriesDropDownList" runat="server" DataSourceID="SqlDataSource2" DataTextField="Name" DataValueField="CountryID" Width="220px" AutoPostBack="True"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource2...

Web resources about - "Error converting data type nvarchar to numeric." - asp.net.object-datasource

Resources last updated: 12/2/2015 2:49:26 AM