日期:2014-05-17 浏览次数:20467 次
protected void lkupdzlxx_Click(object sender, EventArgs e)
{
try
{
sqlcon scn = new sqlcon();
scn.con();
scn.setinsert("治疗信息(ID, 治疗方式, 剂量, 计划, 实际, 开始时间, 结束时间,结束提醒)",
"'" + txtid.Text + "'," + "'" + txt1zhiliaofangshi.Text + "'," + "'" + txt2jiliang.Text + "'," +
"'" + txt3jihua.Text + "',"
+ "'" + txt4shiji.Text + "'," +
"'" + txt5starttime.Text + "'," +
"'" + txt6endtime.Text + "'," +
"'" + txt7remindtime.Text + "'");
Response.Write("success");
}
catch { Response.Write("false"); }
}
public void setinsert(string columnname,string insertstring)
{
sda.InsertCommand = new SqlCommand( "insert into " + columnname + " values (" + insertstring + ")");
}
"insert into 治疗信息(ID, 治疗方式, 剂量, 计划, 实际, 开始时间, 结束时间,结束提醒)
values ('2','q','q','q','q','2013-11-5 09:31:16',
'2013-11-5 10:31:16','2013-11-5 10:26:16')"、
//此时数据库中无生成内容。
//将该语句复制到sql查询中得到1行影响,数据被添加