In this post CommentBox in Asp.Net
Important Namespaces Used ------------------------- using System.Data; using System.Data.SqlClient; ------------------------- Submit Button Click Event ------------------------- String dateofcomment; dateofcomment = DateTime.Now.ToLongDateString().ToString(); String query = "insert into commentdetail(visitorname,email,comment,dateofcomment) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + dateofcomment + "')"; String mycon = "Data Source=sk-pc; Initial Catalog=CommentBox; Integrated Security=true"; SqlConnection con = new SqlConnection(mycon); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = query; cmd.Connection = con; cmd.ExecuteNonQuery(); DataList1.DataBind(); Label6.Text = "Thanks For Giving Feedback as Comment on Website"; --------------------------