内容添加asp.net
摘要:privatevoidButton1_Click(objectsender,System.EventArgse){if(this.IsVal...
privatevoidButton1_Click(objectsender,System.EventArgse)
{
if(this.IsValid){
OleDbConnectionconn=dbconn.createconn();
conn.Open();
OleDbCommandcmd=newOleDbCommand();
cmd.CommandText="insertintoa(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 2.0/3.5中直接操作Gridview控件插入新记录
★ Community Server专题三:HttpModule
★ ASP.NET jQuery 实例8 (动态添加内容到DropDownList)
★ Asp.Net 文件操作基类(读取,删除,批量拷贝,删除,写入,获取文件夹大小,文件属性,遍历目录)
上一篇:
repeater分页 内容显示
下一篇:
VS2003 SP1发布