C
Catalin Porancea
Whenever I try this:
____________________________________________________________________
Dim cmd_sp_payments As SqlCommand = New SqlCommand("sp_payments", con)
cmd_sp_payments.CommandType = CommandType.StoredProcedure
Dim CustID As SqlParameter = cmd_sp_payments.Parameters.Add("@cust_id",
SqlDbType.Text)
CustID.Value = strCustID
Dim myReader As SqlDataReader = cmd_sp_payments.ExecuteReader()
If myReader.HasRows Then
Dim strLastPayAmt As String = "$" & myReader.GetString("Pay_Amount")
lblLastPayAmt.Text = strLastPayAmt
myReader.Close()
Else
myReader.Close()
End If
_______________________________________________________________________
I get this error:
_______________________________________________________________________
Operand type clash: text is incompatible with int
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Operand type clash:
text is incompatible with int
Source Error:
Line 140: CustID.Value = strCustID
Line 141:
Line 142: Dim myReader As SqlDataReader =
cmd_sp_payments.ExecuteReader()
Line 143: If myReader.HasRows Then
Line 144: Dim strLastPayAmt As String = "$" &
myReader.GetString("Pay_Amount")
Source File: C:\Inetpub\wwwroot\MTIWEB\CustomerPage.aspx.vb Line: 142
Stack Trace:
[SqlException: Operand type clash: text is incompatible with int]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteReader()
MTIWEB.CustomerPage.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\MTIWEB\CustomerPage.aspx.vb:142
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
____________________________________________________________________________
_____________________
Can anybody help?
Thank you.
____________________________________________________________________
Dim cmd_sp_payments As SqlCommand = New SqlCommand("sp_payments", con)
cmd_sp_payments.CommandType = CommandType.StoredProcedure
Dim CustID As SqlParameter = cmd_sp_payments.Parameters.Add("@cust_id",
SqlDbType.Text)
CustID.Value = strCustID
Dim myReader As SqlDataReader = cmd_sp_payments.ExecuteReader()
If myReader.HasRows Then
Dim strLastPayAmt As String = "$" & myReader.GetString("Pay_Amount")
lblLastPayAmt.Text = strLastPayAmt
myReader.Close()
Else
myReader.Close()
End If
_______________________________________________________________________
I get this error:
_______________________________________________________________________
Operand type clash: text is incompatible with int
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Operand type clash:
text is incompatible with int
Source Error:
Line 140: CustID.Value = strCustID
Line 141:
Line 142: Dim myReader As SqlDataReader =
cmd_sp_payments.ExecuteReader()
Line 143: If myReader.HasRows Then
Line 144: Dim strLastPayAmt As String = "$" &
myReader.GetString("Pay_Amount")
Source File: C:\Inetpub\wwwroot\MTIWEB\CustomerPage.aspx.vb Line: 142
Stack Trace:
[SqlException: Operand type clash: text is incompatible with int]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteReader()
MTIWEB.CustomerPage.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\MTIWEB\CustomerPage.aspx.vb:142
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
____________________________________________________________________________
_____________________
Can anybody help?
Thank you.