Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click Dim con As New SqlConnection("Data Source=kandy\sqlexpress;Initial Catalog=nicky;Integrated Security=True") con.Open() Dim cmd As New SqlCommand("insert into [User] (Username,Subject,Comment,PostedDate) values(@UserName,@Subject,@Comment,@PostedDate)", con) cmd.Parameters.AddWithValue("@userName", txtName.Text) cmd.Parameters.AddWithValue("@subject", txtSubject.Text) cmd.Parameters.AddWithValue("@comment", txtComment.Text) cmd.Parameters.AddWithValue("@postedDate", DateTime.Now) cmd.ExecuteNonQuery() con.Close() txtName.Text = String.Empty txtSubject.Text = String.Empty txtComment.Text = String.Empty BindRepeaterData()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)