Posted on: 2/21/2014 11:57:18 PM | Views : 642

All:

I have a button on my form called Remove and a Textbox that I want user to enter a value and once they click the Remove button it runs the stored procedure that does a simple delete statment.

Here is my code:

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click Dim myConn As SqlConnection Dim cmd As SqlCommand Dim sqlstring, Hostname As String
Hostname = TextBox13.Text

myConn = New SqlConnection("Data Source=SQLCLUSTER;Initial Catalog=SQLdefragRepository;Integrated Security=True")
myConn.Open()
sqlstring = ("Exec RemoveRecord").value = TextBox13.Text
cmd = New SqlCommand(sqlstring, myConn)
cmd.ExecuteNonQuery()
myConn.Close()
Response.Redirect(Request.RawUrl, True)





Go to the complete details ...