Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 20th, 2004, 11:15 AM
Authorized User
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default decimal parameters

Hi to all!!

I am trying to update a table within my application, but I have problems with the insert command, defined like this:

            cmd = new SqlCommand("INSERT INTO CATEGORIAS(cat_descripcion, cat_precio_hora) " +
                "VALUES (@cat_descripcion, @cat_precio_hora); " +
                "SELECT cod_categoria, cat_descripcion, cat_precio_hora " +
                "FROM CATEGORIAS WHERE (cod_categoria = @@IDENTITY)", myConnection);
            cmd.Parameters.Add("@cat_descripcion", SqlDbType.VarChar, 30, "cat_descripcion");
            cmd.Parameters.Add("@cat_precio_hora", SqlDbType.Decimal, 9, "cat_precio_hora");
            daProveedores.InsertCommand = cmd;

I think the problem is the column 'cat_precio_hora', that is defined like numeric(10,2) in my creation script.

I don't know how to do?

Anybody can help?


World only exists into your mind.
Old September 20th, 2004, 08:19 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


Try creating a SQLParameter object. You should be able to do it that way.


Similar Threads
Thread Thread Starter Forum Replies Last Post
decimal data type all 0's after decimal gobotsoup SQL Server ASP 1 February 28th, 2007 02:32 PM
Decimal point marcusbris Visual Basic 2005 Basics 3 January 18th, 2007 05:55 AM
decimal harpua Beginning PHP 1 November 3rd, 2005 10:17 PM
Decimal Point interrupt Javascript How-To 4 March 16th, 2005 05:53 AM
Getting decimal value snowydust VB How-To 1 October 18th, 2004 10:25 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.