代码如下:在点击按钮时进行修改操作
private void Button1_Click(object sender, System.EventArgs e)
{
int pdid=Convert.ToInt32(Request.QueryString["Infor"]);
Response.Write(pdid);
string strconn = "Initial Catalog=exam;Data Source=(local);user id=sa;password=";
Response.Write(addzw.Text);
string strSQL2="update pdt set pcontent='" + addzw.Text + "',pdaan='"+zdaan.SelectedValue+"',pdifxs='"+ndxs.SelectedValue+"'where pdid='" + pdid + "'";
SqlConnection objcn1=new SqlConnection(strconn);
SqlCommand objcm2=new SqlCommand(strSQL2,objcn1);
SqlDataReader objr2=null;
//objr1.Close();
objcn1.Open();
objr2=objcm2.ExecuteReader(CommandBehavior.CloseConnection);
objr2.Close();
}
谢谢各位了
private void Button1_Click(object sender, System.EventArgs e)
{
int pdid=Convert.ToInt32(Request.QueryString["Infor"]);
Response.Write(pdid);
string strconn = "Initial Catalog=exam;Data Source=(local);user id=sa;password=";
Response.Write(addzw.Text);
string strSQL2="update pdt set pcontent='" + addzw.Text + "',pdaan='"+zdaan.SelectedValue+"',pdifxs='"+ndxs.SelectedValue+"'where pdid='" + pdid + "'";
SqlConnection objcn1=new SqlConnection(strconn);
SqlCommand objcm2=new SqlCommand(strSQL2,objcn1);
SqlDataReader objr2=null;
//objr1.Close();
objcn1.Open();
objr2=objcm2.ExecuteReader(CommandBehavior.CloseConnection);
objr2.Close();
}
谢谢各位了
解决方案 »
- 100分求jquery调用webservice,无刷新分页显示(已写好webservice)
- 怎么样给Image控件加Click事件?
- 哪位有整合过ucenter啊?我的提示通信失败
- 如何将后台数据库表某一个字段的值赋给前台js array?
- DataGrid高分问题
- 请问为什么gridview的hyperlinkfield属性传递的参数值不全 (汉字丢失最后一个字)
- 关于代码注释的疑问
- 关于Http管道注册的问题,到底应该放在什么位置!
- Table服务器控件中可以插入其他子控件吗?
- dreamweaver中作的网页放到.net中的添加控件问题。
- 求电子邮件发送的关于附件的添加删除和发送的源程序
- datagrid模板列的显示格式问题???
where 前面少了个空格