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_User_Opinion : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btn_sabt_Click(object sender, EventArgs e) { SqlConnection connect=new SqlConnection(); connect.ConnectionString=ConnectionStr.ConnectionString; DataSet ds = new DataSet(); SqlDataAdapter da= new SqlDataAdapter("select * from tbl_opinion", connect); da.Fill(ds,"tbl_opinion"); DataRow dr = ds.Tables["tbl_opinion"].NewRow(); dr["opinion"] = txt_opinion.Text; dr["name"] = txt_Name.Text; dr["date"] = DateTime.Now; ds.Tables["tbl_opinion"].Rows.Add(dr); SqlCommandBuilder cb = new SqlCommandBuilder(da); da.Update(ds, "tbl_opinion"); Response.Redirect("~/page/User/Opinion.aspx"); } }