Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
this error message comes out>>>>>> 'btnSubmit_Click' is not a member of 'ASP.comments_aspx'.


VB
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()
Posted
Updated 13-Jun-12 6:33am
v2
Comments
Sandeep Mewara 13-Jun-12 12:21pm    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
hidayatalishah 26-Jun-13 5:36am    
Error 4 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900