新手,求帮助
new OracleParameter{ ParameterName=":a0",DbType= WcfDb.DbType.String, Value= txtHZXM .Text },new OracleParameter{ ParameterName=":a1",DbType= WcfDb.DbType.Date, Value= dateTimePicker1.Value.Date },
new OracleParameter{ ParameterName=":a2",DbType=WcfDb.DbType.String , Value= CheckByRadio(grbCHS) },
new OracleParameter{ ParameterName=":a3",DbType=WcfDb.DbType.String , Value= CheckByRadio(grbGCCHS) },
new OracleParameter{ ParameterName=":a4",DbType= WcfDb.DbType.String, Value= CheckByRadio(grbJKCHS) },
new OracleParameter{ ParameterName=":a5",DbType= WcfDb.DbType.String, Value= CheckByRadio(grbFSJL) },
new OracleParameter{ ParameterName=":a6",DbType= WcfDb.DbType.Decimal, Value=Convert.ToDecimal(txtDCZS.Text)},
new OracleParameter{ ParameterName=":a7",DbType= WcfDb.DbType.Decimal, Value= Convert.ToDecimal(txtDCXS.Text) },
new OracleParameter{ ParameterName=":a8",DbType= WcfDb.DbType.String, Value= cbbJL.Text },
new OracleParameter{ ParameterName=":a9",DbType=WcfDb.DbType.String , Value= CheckByRadio(grbYYPL) },
new OracleParameter{ ParameterName=":a10",DbType=WcfDb.DbType.String , Value= cbbDWSJ.Text },
};
string sqladdCHS = @"INSERT into PD_ERYTHROPOIETIN_USE_RECORD(PATIENT_ID, PRESCRIPT_DATE, CHSZL, GCCHS, JKCHS, GYFS, DCJLGL, DCJL, JLDW, YYCS, DWSJ) VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8,:a9,:a10)";
List<WcfDb.OracleParameter> listOrclPara = new List<OracleParameter>();
接下来怎么写代码,不会来,新手真心求帮助 c#.oracal. --------------------编程问答-------------------- 你参考一下这样的写法:
1、http://blog.csdn.net/guwei4037/article/details/9095387
2、http://blog.csdn.net/guwei4037/article/details/9474105 --------------------编程问答-------------------- 因为你只有一条语句需要插入,接下来可以这么写。
OracleCommand cmd = new OracleCommand(sqladdCHS, connection);//sqladdCHS为sql语句,connection为数据库连接对象--------------------编程问答-------------------- 打开MSDN,然后搜索一下ADO.net 中的OracleCommand.ExecuteNonQuery(); --------------------编程问答-------------------- 我给你们源代码,帮我写一下,我是真不会写,就是在省略号的位置如何写。求帮助
return cmd.ExecuteNonQuery();
private void btnOKCHS_Click_1(object sender, EventArgs e)
{
ServiceClient client = new ServiceClient();
WcfDb.OracleParameter[] oParms =
{
new OracleParameter{ ParameterName=":a0",DbType= WcfDb.DbType.String, Value= txtHZXM .Text },
new OracleParameter{ ParameterName=":a1",DbType= WcfDb.DbType.Date, Value= dateTimePicker1.Value.Date },
new OracleParameter{ ParameterName=":a2",DbType=WcfDb.DbType.String , Value= CheckByRadio(grbCHS) },
new OracleParameter{ ParameterName=":a3",DbType=WcfDb.DbType.String , Value= CheckByRadio(grbGCCHS) },
new OracleParameter{ ParameterName=":a4",DbType= WcfDb.DbType.String, Value= CheckByRadio(grbJKCHS) },
new OracleParameter{ ParameterName=":a5",DbType= WcfDb.DbType.String, Value= CheckByRadio(grbFSJL) },
new OracleParameter{ ParameterName=":a6",DbType= WcfDb.DbType.Decimal, Value=Convert.ToDecimal(txtDCZS.Text)},
new OracleParameter{ ParameterName=":a7",DbType= WcfDb.DbType.Decimal, Value= Convert.ToDecimal(txtDCXS.Text) },
new OracleParameter{ ParameterName=":a8",DbType= WcfDb.DbType.String, Value= cbbJL.Text },
new OracleParameter{ ParameterName=":a9",DbType=WcfDb.DbType.String , Value= CheckByRadio(grbYYPL) },
new OracleParameter{ ParameterName=":a10",DbType=WcfDb.DbType.String , Value= cbbDWSJ.Text },
};
string sqladdCHS = @"INSERT into PD_ERYTHROPOIETIN_USE_RECORD(PATIENT_ID, PRESCRIPT_DATE, CHSZL, GCCHS, JKCHS, GYFS, DCJLGL, DCJL, JLDW, YYCS, DWSJ) VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8,:a9,:a10)";
List<WcfDb.OracleParameter> listOrclPara = new List<OracleParameter>();
。。。。。。。。。。。。。。。。。。。。。。。。。。。。
//listOrclPara.Add(new OracleParameter { ParameterName = "sqladdCHS", DbType = WcfDb.DbType.String, Value = this.txtQT.Text });
int effectRowCount = client.ExecuteNonQuery(WcfDb.CommandType.Text, sqladdCHS, listOrclPara.ToArray());
if (effectRowCount > 0)
{
MessageBox.Show("添加成功");
}
else
{
MessageBox.Show("添加失败");
}
client.Close();
}
补充:.NET技术 , C#