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 9023887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:52:19+00:00 2026-06-16T05:52:19+00:00

I have a GridView in which I have check box as Item Template, and

  • 0

I have a GridView in which I have check box as Item Template, and I am updating the GridView when check box is changed. Here is my GridView code:

<Columns>
    <telerik:GridTemplateColumn>
    <ItemTemplate>
        <asp:CheckBox ID="chkcelar" runat="server" Text="Clear" OnCheckedChanged="chkclearchng" AutoPostBack="true"/>
    </ItemTemplate>
    </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="BPV_NUM" DataType="System.Int64"
            DefaultInsertValue="" HeaderText="BPV No" SortExpression="BPV_NUM" 
            UniqueName="BPV_NUM">
        </telerik:GridBoundColumn>
</Columns>

and here is the c# code through which I am updating grid view

protected void chkclearchng(object sender, EventArgs e)
    {
        OleDbConnection con = new OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle");
        OleDbCommand cmd  = new OleDbCommand();
        CheckBox chkcelar = ((CheckBox)(sender));
        GridDataItem  row = ((GridDataItem)(chkcelar.NamingContainer));
        long bpvnum = row.Cells[1].Text;

        if (chkcelar.Checked ) {
            cmd.CommandText = @"update sml.FND_01_11@wbg set CLR_FLG=1, CLR_DTE=sysdate where bpv_num=:bpv_num and bpv_dte=:bpv_dte";
        }
        else {
            cmd.CommandText = @"update sml.FND_01_11@wbg set CLR_FLG=0, CLR_DTE=sysdate where bpv_num=:bpv_num and bpv_dte=:bpv_dte";
        }
        cmd.CommandType = CommandType.Text;
        cmd.Connection  = con;

        cmd.Parameters.Add(":bpv_num",OleDbType.BigInt).Value = bpvnum;
        cmd.Parameters.Add(":bpv_dte",OleDbType.Date).Value   = RadComboBox1.SelectedValue;

        con.Open();
        cmd.ExecuteNonQuery();
        con.Close(); 

    }

The problem is that when I change the check box this error appears:

Input string was not in a correct format.

Can anyone tell what may be the issue and how can I resolve it?

  • 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-16T05:52:20+00:00Added an answer on June 16, 2026 at 5:52 am

    Change your code like this:

        protected void chkclearchng(object sender, EventArgs e)
        {
            using (OleDbConnection con = new OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle"))
            {
                con.Open();
                using (OleDbCommand cmd = new OleDbCommand(null, con))
                {
                    CheckBox chkcelar = ((CheckBox)(sender));
                    GridDataItem row = ((GridDataItem)(chkcelar.NamingContainer));
                    long bpvnum = Convert.ToInt64(row.Cells[1].Text);
                    if (chkcelar.Checked)
                    {
                        cmd.CommandText = @"update sml.FND_01_11@wbg set CLR_FLG=1, CLR_DTE=sysdate where bpv_num=@bpv_num and bpv_dte=@bpv_dte";
                    }
                    else
                    {
                        cmd.CommandText = @"update sml.FND_01_11@wbg set CLR_FLG=0, CLR_DTE=sysdate where bpv_num=@bpv_num and bpv_dte=@bpv_dte";
                    }
                    cmd.Parameters.Add(new OleDbParameter("@bpv_num", bpvnum));
                    cmd.Parameters.Add(new OleDbParameter("@bpv_dte", Convert.ToDateTime(RadComboBox1.SelectedValue)));
                    cmd.ExecuteNonQuery();
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have gridview in which i have check box control Like this image. Problem
I have one GridView gvDetail which has 30 columns(include both Template and BoundField). In
Here i have gridview which contain some values retrieved from database.We put radiobutton list
I have gridview which has columns of data and a button below the Apply
i have made a gridview which has many columns and the editmode , some
I have a gridview to which I have created an Insert Template in the
I have GridView, which is not auto generating columns. In GridView there are 3
I have a GridView which is programatically filled from the DB (not a SqlDataSource
I have a GridView which I am populating by calling a method to return
I have a GridView which is databound to an XML Datasource. For one 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.