using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class page_Admin_News_Reg : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { SqlConnection connect = new SqlConnection(); connect.ConnectionString = ConnectionStr.ConnectionString; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter("select * from tbl_news", connect); da.Fill(ds, "tbl_news"); DataRow dr = ds.Tables["tbl_news"].NewRow(); dr["title"] = txttitle.Text; dr["news"] = txtnews.Text; dr["writer"] = txtwriter.Text; ds.Tables["tbl_news"].Rows.Add(dr); SqlCommandBuilder cb = new SqlCommandBuilder(da); da.Update(ds, "tbl_news"); txtnews.Text = ""; txttitle.Text = ""; txtwriter.Text = ""; } }