M
Martin Feuersteiner
Dear Group
I'm having trouble with the script below. How do I set the RequestType so
the script will use POST instead of GET?
I tried the script below with no luck.
Thanks for your time & efforts!
Martin
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Request.RequestType = "POST"
'Open Database Connection
clsData.OpenSQLConnection()
Dim prm1 As SqlClient.SqlParameter 'SenderTxt
Dim prm2 As SqlClient.SqlParameter 'TimeTxt
Dim prm3 As SqlClient.SqlParameter 'MessageTxt
Dim prm4 As SqlClient.SqlParameter 'KeywordTxt
Dim str1 As String = "EXEC sp_SaveSMS @SenderTxt, @TimeTxt,
@MessageTxt, @KeywordTxt"
Dim cmd1 As New SqlClient.SqlCommand(str1, SQLConnection)
prm1 = cmd1.CreateParameter
With prm1
.ParameterName = "@SenderTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("sender"))
End With
prm2 = cmd1.CreateParameter
With prm2
.ParameterName = "@TimeTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("time"))
End With
prm3 = cmd1.CreateParameter
With prm3
.ParameterName = "@MessageTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("message"))
End With
prm4 = cmd1.CreateParameter
With prm4
.ParameterName = "@KeywordTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("keyword"))
End With
cmd1.Parameters.Add(prm1)
cmd1.Parameters.Add(prm2)
cmd1.Parameters.Add(prm3)
cmd1.Parameters.Add(prm4)
Try
cmd1.ExecuteNonQuery()
Finally
clsData.CloseSQLConnection()
End Try
End Sub
I'm having trouble with the script below. How do I set the RequestType so
the script will use POST instead of GET?
I tried the script below with no luck.
Thanks for your time & efforts!
Martin
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Request.RequestType = "POST"
'Open Database Connection
clsData.OpenSQLConnection()
Dim prm1 As SqlClient.SqlParameter 'SenderTxt
Dim prm2 As SqlClient.SqlParameter 'TimeTxt
Dim prm3 As SqlClient.SqlParameter 'MessageTxt
Dim prm4 As SqlClient.SqlParameter 'KeywordTxt
Dim str1 As String = "EXEC sp_SaveSMS @SenderTxt, @TimeTxt,
@MessageTxt, @KeywordTxt"
Dim cmd1 As New SqlClient.SqlCommand(str1, SQLConnection)
prm1 = cmd1.CreateParameter
With prm1
.ParameterName = "@SenderTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("sender"))
End With
prm2 = cmd1.CreateParameter
With prm2
.ParameterName = "@TimeTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("time"))
End With
prm3 = cmd1.CreateParameter
With prm3
.ParameterName = "@MessageTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("message"))
End With
prm4 = cmd1.CreateParameter
With prm4
.ParameterName = "@KeywordTxt"
.SqlDbType = SqlDbType.VarChar
.Value = CStr(Request.QueryString("keyword"))
End With
cmd1.Parameters.Add(prm1)
cmd1.Parameters.Add(prm2)
cmd1.Parameters.Add(prm3)
cmd1.Parameters.Add(prm4)
Try
cmd1.ExecuteNonQuery()
Finally
clsData.CloseSQLConnection()
End Try
End Sub