1:string bb=((TextBox)DataGrid1.Items[i].Cells[0].FindControl("TextBox2"))myConmmand.Parameters.Add(new SqlParameter("@xbbs",SqlDbType.Decimal,9));
myConmmand.Parameters ["@xbbs"].Value=Convert.ToDecimal(bb.ToString());
我要在"].Value=后取bb的值,这样写有错,请咅应怎样写?
2:SqlCommand bb=new SqlCommand ("select wzdm into str_wzdm from b_wzxx where wzmc=str_wzmc SUBSTRING(wzdm,1,10)",conn);
myConmmand.Parameters ["@wzdm"].Value=     ;
问一下,我想把str_wzdm这个变量的值放在Value=的后面怎么放呀?还有SQL能直接写在.Value=的后面吗?

解决方案 »

  1.   

    1:string bb=((TextBox)DataGrid1.Items[i].Cells[0].FindControl("TextBox2"))myConmmand.Parameters.Add(new SqlParameter("@xbbs",SqlDbType.Decimal,9));
    myConmmand.Parameters ["@xbbs"].Value=Convert.ToDecimal(bb.ToString());
    我要在"].Value=后取bb的值,这样写有错,请咅应怎样写?
    -------------------------------------------------------------------------------------
    string bb=((TextBox)DataGrid1.Items[i].Cells[0].FindControl("TextBox2")).Text;
    SqlParameter para=new SqlParameter("@xbbs",SqlDbType.Decimal,9);
    para.Value=Convert.ToDecimal(bb.ToString());
    myConmmand.Parameters.Add(para);
      

  2.   

    2:SqlCommand bb=new SqlCommand ("select wzdm into str_wzdm from b_wzxx where wzmc=str_wzmc SUBSTRING(wzdm,1,10)",conn);
    myConmmand.Parameters ["@wzdm"].Value=     ;
    问一下,我想把str_wzdm这个变量的值放在Value=的后面怎么放呀?还有SQL能直接写在.Value=的后面吗?sql文不正确!你想写什么功能的sql文?
    描述一下!
      

  3.   

    问的不明白还好意思说别人答的有误? 一楼回答是对的,你其他地方错了.
    第2个问题,你整个Sql就写错了,不知道你要干什么.