When you say "combine", what is your end-goal? Are you trying to issue a single statement cover both?
If you have a collection of keys (e.g. "uniqueCode", "strEmail", etc) to be read, then you could loop through that collection, issuing the call above once for each key. (In case you aren't aware, the List is in System.Collections.Generic.)
So, if you had something like this defined:
- Dim keys As List(Of String)
And then had it populated with all of the keys you're wanting to parse (i.e.
keys.Add("uniqueCode") ), you could issue one statement inside of a loop, such as:
- Dim key As String
-
For Each key In keys
-
cmd.Parameters.AddWithValue("@" & key, Convert.ToString(Request.QueryString(key)))
-
Next key
`
I hope this helps.
-J
EDIT: It may also be of interest to note that (in VB.Net, anyway) the List(...) types have a "ForEach" method on them that makes the same loop, so the above code could also be written as:
- keys.ForEach(cmd.Parameters.AddWithValue("@" & key, Convert.ToString(Request.QueryString(key))))