Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8611247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:19:40+00:00 2026-06-12T04:19:40+00:00

I am struggling with an error. I`ve checked my stored procedure and code, but

  • 0

I am struggling with an error. I`ve checked my stored procedure and code, but i don’t know what and where the problem is actually existing. The Error.

MY SP:

    ALTER PROCEDURE [dbo].[sp_Tbl_Contract_Insert]
    -- Add the parameters for the stored procedure here
    @ItemID int,
    @BrandID int,
    @CountID int,
    @SellerID int,
    @BuyerID int,
    @CountryFromID int,
    @countryToID int,
    @UnitID int,
    @KeyWinCountNumber varchar(50),
    @ContractNumber varchar(50),
    @ContractDate varchar(50),
    @TotalQty varchar(50),
    @Vans varchar(50),
    @UnitPrice decimal(18,2),
    @TotalAmount decimal(18,2)


    AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.

    -- Insert statements for procedure here

    Insert into Tbl_Contract (ItemID,BrandID,CountID,SellerID,BuyerID,
    CountryFromID,CountryToID,UnitID,
    KeyWinCountNumber,ContractNumber,ContractDate,TQty,Vans,
    UnitPrice,TAmount) values ( @ItemID,@BrandID,@CountID,@SellerID,@BuyerID,@CountryFromID,
    @countryToID,@UnitID,@KeyWinCountNumber,@ContractNumber,@ContractDate,@TotalQty,
    @Vans,@UnitPrice,@TotalAmount)

END

CODE:

if (ViewState["action"].ToString() == "Insert")
    {
        try
        {
            obj = new DalLib();
            paramArray = new string[16, 2];
            paramArray[0, 0] = "@ItemID";
            paramArray[0, 1] = ddlItem.SelectedValue.ToString();
            paramArray[1, 0] = "@BrandID";
            paramArray[1, 1] = ddlBrand.SelectedValue.ToString();
            paramArray[2, 0] = "@CountID";
            paramArray[2, 1] = ddlCount.SelectedValue.ToString();
            paramArray[3, 0] = "@SellerID";
            paramArray[3, 1] = ddlSellerName.SelectedValue.ToString();
            paramArray[4, 0] = "@BuyerID";
            paramArray[4, 1] = ddlBuyerName.SelectedValue.ToString();
            paramArray[5, 0] = "@CountryFromID";
            paramArray[5, 1] = ddlCountryFrom.SelectedValue.ToString();
            paramArray[6, 0] = "@countryToID";
            paramArray[6, 1] = ddlCountryTo.SelectedValue.ToString();
            paramArray[7, 0] = "@UnitID";
            paramArray[7, 1] = ddlUnit.SelectedValue.ToString();
            paramArray[8, 0] = "@KeyWinCountNumber";
            paramArray[8, 1] = txtkeyWinCount.Text;
            paramArray[9, 0] = "@ContractNumber";
            paramArray[9, 1] = txtContractNum.Text;
            paramArray[10, 0] = "@ContractDate";
            paramArray[10, 1] = txtContractDate.Text;
            paramArray[11, 0] = "@TotalQty";
            paramArray[11, 1] = txttotalqty.Text;
            paramArray[12, 0] = "@Vans";
            paramArray[12, 1] = txtVans.Text;
            paramArray[13, 0] = "@UnitPrice";
            paramArray[13, 1] = txtUnitPrice.Text;
            paramArray[14, 0] = "@TotalAmount";
            paramArray[14, 1] = txtTotal.Text;
            paramArray[15, 0] = "`";
            result = obj.setData("sp_Tbl_Contract_Insert", paramArray);
            mtvResult.ActiveViewIndex = 0;
            LoadData();
            EmptyFields();
        }
        catch
        {
        }
    }

My DB_Columns:
DatabaseTable Columns

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:19:42+00:00Added an answer on June 12, 2026 at 4:19 am

    Maybe someone entered a text into your price field (which should be a decimal) or maybe someone used , in stead of .

    replace paramArray[13, 1] = txtUnitPrice.Text;
    

    with (and do something similar for all numerical values)

    paramArray = Convert.ToDecimal(txtUnitPrice.Text, new System.Globalization.CultureInfo("en-US"));
    

    If you want to use the format “1.0”, use other culture information if you want a different format. Also you should catch NumberFormatException and tell the user to use a specific format. In case the user uses the wrong format or says something like “my year salary!” 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know the meaning of this error, but I'm really struggling with it, and
I am struggling with the code when I run it I get this error.
I'm struggling with compile error C3200 http://msdn.microsoft.com/en-us/library/3xwxftta.aspx discusses the problem and gives as an
I've been struggling with this error for quite some time: Redis::ProtocolError: Got 'i' as
I have been struggling with this error for more than two hours: error: aggregate
I'm a newbie to iphone development and I've been struggling with an EXC_BAD_ACCESS error
I have been struggling with this seeminly easy problem for 48 hours, and I
I've been struggling for a few days with this problem , learning a lot
I've been struggling with this error for several days with little headway. Basically, I'm
I am struggling to understand how I should design the error handling parts of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.