|
-
May 3rd, 2004, 11:05 AM
#1
Thread Starter
New Member
update sql
I am trying to update my SQL database. With this code it will not work if I want to pass it the text from a textbox. If I set
Dim outgoingpath As String = TextBox1.Text
it does not work... if I do this instead
Dim outgoingpath As String = "test"
it works. Is there something special I have to do to the textbox to make it work? Thanks.
Dim PathInfo As String
PathInfo = Request.QueryString("OutGoingPath")
Dim strConnection As String
Dim outgoingpath As String = TextBox1.Text
strConnection = "data source=jwallace;initial catalog=Jt;password=testadmin;persist security info=True;user id=Julie;workstation id=Jw;"
Dim mySelectQuery As String = "UPDATE Gateway SET OutGoingPath = '" & outgoingpath & "' WHERE OutGoingPath= '" & PathInfo & "' "
Dim myConnection As New SqlConnection(strConnection)
Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|