这段简单的数据库操作的代码我调了好久 不知道哪错了
protected void btn_submit_Click(object sender, EventArgs e)
{
string strconn = ConfigurationSettings.AppSettings[ "dsn "];
SqlConnection cn = new SqlConnection(strconn);
cn.Open();
SqlCommand cm = new SqlCommand( "ContractModifyForControl ", cn);
cm.CommandType = CommandType.StoredProcedure;
cm.Parameters.Add( "@TID ", SqlDbType.VarChar);
cm.Parameters[ "@TID "].Value = tbx_tid.Text.ToString();
SqlCommand cm1 = new SqlCommand( "ContractProgressInforAdd ", cn);
cm1.CommandType = CommandType.StoredProcedure;
cm1.Parameters.Add( "@ITID ", SqlDbType.VarChar);
cm1.Parameters.Add( "@IDate ", SqlDbType.VarChar);
cm1.Parameters[ "@ITID "].Value = tbx_tid.Text.ToString();
cm1.Parameters[ "@IDate "].Value = System.DateTime.Now;
if (rtn_finished.Checked == true)
{
cm.Parameters.Add( "@TReadyMoney ", SqlDbType.Money);
cm.Parameters.Add( "@TState ", SqlDbType.Int);
cm.Parameters[ "@TReadyMoney "].Value = Convert.ToDouble(tbx_ttotalmoney.Text.ToString());
cm.Parameters[ "@TState "].Value = 2;
cm.ExecuteNonQuery();
cm1.Parameters.Add( "@IPay ", SqlDbType.Money);
cm1.Parameters.Add( "@IDescribe ", SqlDbType.VarChar);
cm1.Parameters[ "@IPay "].Value = Convert.ToDouble(tbx_ttotalmoney.Text.ToString()) - Convert.ToDouble(tbx_treadymoney.Text.ToString());
cm1.Parameters[ "@IDescribe "].Value = tbx_describe.Text.ToString();