Error Converting Data Type Numeric To Decimal Vb.net
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Sql Exception: Error converting data type numeric to numeric [closed] up vote 6 down vote favorite We have a very strange issue with a database that has been moved from staging to production. The first time the database was moved it was by detaching, copying and reattaching, the second time we tried restoring from a backup of the staging. Both SQL Servers are the same version of MS SQL 2008, running on 64 bit hardware. The code accessing the database is the same build, built using the .net 2.0 framework. Here is the error message and some of the stack trace: Exception Details: System.Data.SqlClient.SqlException: Error converting data type numeric to numeric. Stack Trace: [SqlException (0x80131904): Error converting data type numeric to numeric.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1953274 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849707 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137 Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016 If I use Re
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack http://stackoverflow.com/questions/2989983/sql-exception-error-converting-data-type-numeric-to-numeric Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Converting data http://stackoverflow.com/questions/18955465/error-converting-data-type-numeric-to-decimal-help type 'Numeric' to Decimal (help!) up vote 4 down vote favorite Good Day Everyone, As of now im stuck with this error Error Converting data type 'Numeric' to Decimal this is my code AddManualItems AddReconItem = new AddManualItems(); UserAccess user = new UserAccess(); AddReconItem.BranchCode = BranchCodeTextBox.Text; AddReconItem.ForLoanMonth = YearDropDownList.SelectedValue + "/" + MonthDropDownList.SelectedValue; AddReconItem.ItemWeight = Convert.ToDecimal(WeightTextBox.Text); AddReconItem.PrincipalAmount = Convert.ToDecimal(PrincipalTexAmTextBox.Text); AddReconItem.PawnTicket = PwnTicketTextBox.Text; AddReconItem.ItemStorageGroup = Convert.ToInt16(StorageNameDropDownList.SelectedValue); AddReconItem.ReconID = Convert.ToInt16(ReconTypeDropDownList.SelectedValue); user.UserID = Session["UserID"].ToString(); string a = servs.AddItemRecon(user, AddReconItem); // this is where the error appears in debug mode the code inside of the ADDitemRecon(User,AddReconItem) is this using (SqlConnection reportsConn = new SqlConnection(sqlConnWriter)) { reportsConn.Open(); SqlCommand AddReconItem = new SqlCommand(); AddReconItem.Connection = reportsConn; AddReconItem.CommandType = CommandType.StoredProcedure; AddReconItem.CommandText = "Updater.usp_AddReconcileItems"; AddReconItem.Parameters.AddWithValue("@ITEMWEIGHT", Convert.ToDecimal( items.ItemWeight)); AddReconItem.Parameters.AddWithValue("@ITEMPRINCIPALAMT", Convert.ToDecimal(items.PrincipalAmount)); AddReconItem.Parameters.AddWithValue("@FORLOANMONTH", Convert.ToDateTime(items.ForLoanMonth)); AddReconItem.Parameters.AddWithValue("@STORAGEGROUPID", items.ItemStorageGroup); AddReconItem.Parameters.AddWithValue("@BRANCHCODE", items.Br
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question View Unanswered Questions View All Questions... C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ Error converting data type nvarchar to decimal. Rate this: Please Sign up or sign in to vote. See more: ASP.NET SQL-server-2012 I am using stored procedure and calling it on asp.net.I am getting this error "Error converting data type nvarchar to decimal." there is table call art in which i have parameter as: create procedure arts( @name varchar(50), @description varchar(50), @Price decimal(10,2) ) as begin insert into arts(name,description,Price) values(@name,@description,@Price) end and I am calling it as:SqlCommand cmd=new SqlCommand("spInsertArts",con); cmd.CommandType=System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@name",txtname.Text); cmd.Parameters.AddWithValue("@description",txtdesc.Text); cmd.Parameters.AddWithValue("@Price",txtprice.Text); con.Open(); cmd.ExecuteNonQuery(); When I execute it,it is giving me above exception.please help Posted 28-Apr-14 17:50