I am very confusing with this new toy.. I am facing this error message : "Must Declare the variable '@mHostCode' .. when below codes run:
Try
Dim cmd As System.Data.OleDb.OleDbCommand
Dim mGetAccessTypeCode As String = "Select * from DialPrefix Where HostCode = @mHostCode AND PrefixNo = @mPrefixNo Order by HostCode, PrefixNo"
Dim DataReader As System.Data.OleDb.OleDbDataReader
OleDBConn1.Open()
cmd = New System.Data.OleDb.OleDbCommand()
cmd.CommandText = mGetAccessTypeCode
cmd.Parameters.Add("@mHostCode", SqlDbType.Char)
cmd.Parameters("@mHostCode").Value = pHostCode ' from paramater
cmd.Parameters.Add("@mPrefixNo", SqlDbType.Char)
cmd.Parameters("@mPrefixNo").Value = pPrefixNo ' from parameter
cmd.CommandType = CommandType.Text
cmd.Connection = OleDBConn1
DataReader = cmd.ExecuteReader
pATypeFound = DataReader.Read
If DataReader.Read Then
pATypeCode = DataReader.GetValue(4)
End If
OleDBConn1.Close()
Catch err As Exception
Message(err.Message)
Finally
OleDBConn1.Close()
End Try
please help me .. TIA
Best Regards
Winan
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only