用户名:
密 码: 记住
您当前的位置:首页 > 网络编程 > Net教程

内容添加asp.net

时间:2015-01-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();
                }
            }
        }
来顶一下
返回首页
返回首页
推荐资讯
ASP.Net生成一个简单的图片 ASP.Net生成一个简单的图片在本节中我们通过生成一个简单的图片作为ASP.NET图形处理的入
C#.Net 学习笔记(一) C#.Net 学习笔记(一)从ASP到ASP.net学习方法以下为我学习.Net的心得,会逐渐添加
相关文章
    无相关信息
栏目更新
栏目热门