日期:2014-05-20  浏览次数:20466 次

新手学习checkbox问题?????
我在GridView中放入几个CheckBox,在更改时,总是提示异常详细信息:   System.Data.OleDb.OleDbException:   标准表达式中数据类型不匹配。代码如下::   protected   void   GridView1_RowUpdating(object   sender,   GridViewUpdateEventArgs   e)
        {
                int   Rid   =   Convert.ToInt32(((Label)GridView1.Rows[e.RowIndex].Cells[11].FindControl( "lblRid ")).Text);
                string   Rname   =   ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl( "txtRname ")).Text;
                CheckBox   OrderSend   =   (CheckBox)GridView1.Rows[e.RowIndex].Cells[2].FindControl( "chkOrderSend ");
                //CheckBox   Production   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[3].FindControl( "chkProduction ")).Checked;
                //CheckBox   Product   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[4].FindControl( "chkProduct ")).Checked;
                //CheckBox   Material   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[5].FindControl( "chkMaterial ")).Checked;
                //CheckBox   Client   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[6].FindControl( "chkClient ")).Checked;
                //CheckBox   Provider   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[7].FindControl( "chkProvider ")).Checked;
                //CheckBox   Employee   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[8].FindControl( "chkEmployee ")).Checked;
                //CheckBox   Finance   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[9].FindControl( "chkFinance ")).Checked;
                //CheckBox   User   =   ((CheckBox)GridView1.Rows[e.RowIndex].Cells[10].FindControl( "chkUser ")).Checked;
                bool   updateok;
                //updateok   =   Convert.ToBoolean(DataOption.Option( "update   [Role]   set   [Rname]= ' "   +   Rname   +   " ',[OrderSend]= ' "   +   OrderSend   +   " '   ,[Production]= ' "   +   Production   +   " ',[Product]= ' "   +   Product   +   " ',[Material]= ' "   +   Material   +   " ',[Client]= ' "   +   Client   +   " ',[Provider]= ' "   +   Provider   +   " ',[Employee]= ' "   +   Employee   +   " ',[Finance]= ' "   +   Finance   +   " ',[User]= ' "   +   User   +   " '   where   Rid= "   +   Rid));
                updateok   =   Convert.ToBoolean(DataOption.Option( "update   [Role]   set   [Rname]= ' "   +   Rname   +   " ',OrderSend= ' "   +   OrderSend.Checked   +   " '   where   Rid= "   +   Rid));
                if   (updateok   ==   true)