OleDbConnection myoledbconnection=new OleDbConnection(myConnection);
OleDbCommand myoledbcommand = myoledbconnection.CreateCommand();
myoledbcommand.CommandText="我的sql语句";
myoledbconnection.Open();try
{
myoledbcommand.ExecuteNonQuery();
myoledbconnection.Close();
Response.Write ("<script>alert(\"提示,录入成功!\");location='yh_up.aspx';</script>");
Response.Redirect("yh_up.aspx");
}
catch
{
Response.Write ("<script>alert(\"提示,录入失败!\");location='yh_up.aspx';</script>");
Response.Redirect("yh_up.aspx");
}
OleDbCommand myoledbcommand = myoledbconnection.CreateCommand();
myoledbcommand.CommandText="我的sql语句";
myoledbconnection.Open();try
{
myoledbcommand.ExecuteNonQuery();
myoledbconnection.Close();
Response.Write ("<script>alert(\"提示,录入成功!\");location='yh_up.aspx';</script>");
Response.Redirect("yh_up.aspx");
}
catch
{
Response.Write ("<script>alert(\"提示,录入失败!\");location='yh_up.aspx';</script>");
Response.Redirect("yh_up.aspx");
}
解决方案 »
- 如何把DataTable添加到dataset中?
- 如何在文本控件中同时存在2种不同的颜色?
- vs2008启动项目时提示“无法连接到asp.net development server”
- ActiveReport入门问题:
- 需要一个变量,各个页面共享,都能访问到,有几种方法?
- 怎样编一个有返回值的ORACLE存储过程
- asp.net 怎样获取 radio的值
- 我得ASP.net调试的时候说我没有权限,请问如何设置,我是用域名登陆的
- 如何定义一个Session数祖啊?
- <%# DataBinder.Eval(Container.DataItem,"name")%> 和 <%# Container.DataItem,"name")%>区别是什么?
- 还是XMLHTTP问题,为何ll=asdf可以入WEBSERVICE里去,而ll=汉字,用request["ll"]取不到值呢?
- 如何能找到免费的listview控件(服务器端控件)
{
myoledbcommand.ExecuteNonQuery();
myoledbconnection.Close();
Response.Write ("<script>alert(\"提示,录入成功!\");location=\"yh_up.aspx\";</script>");
}
catch
{
Response.Write ("<script>alert(\"提示,录入失败!\");location=\"yh_up.aspx\";</script>");
}
Response.Redirect("yh_up.aspx");
OleDbCommand myoledbcommand = myoledbconnection.CreateCommand();
myoledbcommand.CommandText="我的sql语句";
myoledbconnection.Open();try
{
myoledbcommand.ExecuteNonQuery();
myoledbconnection.Close();
this.Page.RegisterStartupScript("ShowMessage","<script id=clientEventHandler language=javascript>alert('提示,录入成功!');window.location='yh_up.aspx''</script>");
}
catch
{
Response.Write ("<script>alert(\"提示,录入失败!\");location='yh_up.aspx';</script>");
}
Response.Redirect("yh_up.aspx");
用Page.RegisterStartupScript 也不好使 黔驴技穷了
高人指点一下
这句去掉!