日期:2014-05-17 浏览次数:20963 次
string str = ConfigurationManager.ConnectionStrings["EmailConn"].ToString();
OleDbConnection conn=new OleDbConnection(str ) ;
conn.Open();
string s = " select * from [D_content]";
OleDbDataAdapter da = new OleDbDataAdapter();
da.SelectCommand = new OleDbCommand(s ,conn );
OleDbCommandBuilder scb = new OleDbCommandBuilder(da );
DataSet ds = new DataSet();
da.Fill(ds );
DataRow newrow = ds.Tables[0].NewRow();
newrow[1] = TextBox1.Text;
ds.Tables[0].Rows.Add(newrow);
da.Update(ds );
conn.Close();
Response.Write("<script>alert('新公告添加成功!');</script>");