AddWithValue NOT working

S

Sonu.NET

txtAssoZip.Text = "Some Data"
txtZip.Text = "Some Data"

Dim strConn As String = "Server Connection"
Dim str As String = "Update ZipLookup SET AssociatedZips=@AssoZip where
Zip=@Zip"
Dim cmd As New SqlCommand(str, New SqlConnection(strConn))

cmd.Parameters.AddWithValue("@AssoZip", txtAssoZip.Text)
cmd.Parameters.AddWithValue("@Zip", txtZip.Text)

cmd.Connection.Open()
cmd.ExecuteNonQuery()
Response.Write(str)

What I am doing wrong here? It is not giving me anything .. Here is what I
get as an output
Update Table1 SET AssociatedZips=@AssoZip where Zip=@Zip

Any help would be great!

Thanks,
SK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top