内容添加asp.net
时间:2024-06-05 09:27:29
private void Button1_Click(object sender, System.EventArgs e)
{
if(this.IsValid){
OleDbConnection conn=dbconn.createconn();
conn.Open();
OleDbCommand cmd=new OleDbCommand();
cmd.CommandText="insert into a(title,content)values('"+this.title.Text.Trim().Replace("'","")+"','"+this.content.Text.Trim().Replace("'","")+"')";
cmd.Connection=conn;
try
{
cmd.ExecuteNonQuery();
this.title.Text="";
this.content.Text="";
this.add_info.Text="提交成功";
}
catch
{
this.add_info.Text="出现错误";
}
finally{
conn.Close();
}
}
}
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
vuecli3.0脚手架搭建及不同的打包环境配置vue.config.js的详细过程
![](https://img.aspxhome.com/file/2023/8/132998_0s.png)
mysql 复制过滤重复如何解决
vue实现评论列表功能
![](https://img.aspxhome.com/file/2023/3/139923_0s.png)
javascript trim、left、right等函数,兼容IE,FireFox
mysql启用skip-name-resolve模式时出现Warning的处理办法
python指定路径斜杠与反斜杠遇到的问题
![](https://img.aspxhome.com/file/2023/6/123466_0s.png)
JDBC数据库连接过程及驱动加载与设计模式详解
Python基础之教你怎么在M1系统上使用pandas
![](https://img.aspxhome.com/file/2023/1/82921_0s.png)
用python实现的去除win下文本文件头部BOM的代码
详解MySQL中的死锁情况以及对死锁的处理方法
Go语言的变量定义详情
Pytest执行unittest TestSuite(测试套件)的实现方法
详解javascript遍历方式
Python基于smtplib协议实现发送邮件
几个图片按比例缩放的代码
基于Python os模块常用命令介绍
![](https://img.aspxhome.com/file/2023/2/121912_0s.png)
Python 实现自动化Excel报表的步骤
![](https://img.aspxhome.com/file/2023/2/70712_0s.jpg)
windows下python 3.6.4安装配置图文教程
![](https://img.aspxhome.com/file/2023/7/77827_0s.jpg)
Python+ Flask实现Mock Server详情
![](https://img.aspxhome.com/file/2023/0/67920_0s.png)
在Web关闭页面时发送Ajax请求的实现方法
![](https://img.aspxhome.com/file/2023/9/136099_0s.jpg)