T
tshad
I have a dataReader that was used a second time in the same routine and got
the following error:
Object must implement IConvertible.
It worked fine just before.
I did a stored procedure call just before, closed the connection, set up the
new parameters for another stored procedure and got the error when it did:
emailReader = objCmd.ExecuteReader
The code (after the 1st stored procedure is):
*****************************************************************
objConn.Close
objCmd.CommandText = "AddNewApplicantProfileAbsentee"
objCmd.Parameters.Clear()
with objCmd.Parameters
.Add("@ClientID",SqlDbType.VarChar,20).value = session("ClientID")
.Add("@ApplicantProfileID",SqlDbType.Bigint).value = ApplicantProfileID
end with
objConn.Open()
itemp = 1
emailReader = objCmd.ExecuteReader
while emailReader.Read
if not (emailReader("From") is DBNull.Value) then
txt = DirectCast(Page.FindControl("AbsentFrom" & itemp),TextBox)
txt.Text = emailReader("From")
end if
if not (emailReader("To") is DBNull.Value) then
txt = DirectCast(Page.FindControl("AbsentTo" & itemp),TextBox)
txt.Text = emailReader("From")
end if
if not (emailReader("Reason") is DBNull.Value) then
txt = DirectCast(Page.FindControl("AbsentReason" & itemp),TextBox)
txt.Text = emailReader("From")
end if
**********************************************************
I've done this before without any problems - what is this IConvertible
business?
Thanks,
Tom
the following error:
Object must implement IConvertible.
It worked fine just before.
I did a stored procedure call just before, closed the connection, set up the
new parameters for another stored procedure and got the error when it did:
emailReader = objCmd.ExecuteReader
The code (after the 1st stored procedure is):
*****************************************************************
objConn.Close
objCmd.CommandText = "AddNewApplicantProfileAbsentee"
objCmd.Parameters.Clear()
with objCmd.Parameters
.Add("@ClientID",SqlDbType.VarChar,20).value = session("ClientID")
.Add("@ApplicantProfileID",SqlDbType.Bigint).value = ApplicantProfileID
end with
objConn.Open()
itemp = 1
emailReader = objCmd.ExecuteReader
while emailReader.Read
if not (emailReader("From") is DBNull.Value) then
txt = DirectCast(Page.FindControl("AbsentFrom" & itemp),TextBox)
txt.Text = emailReader("From")
end if
if not (emailReader("To") is DBNull.Value) then
txt = DirectCast(Page.FindControl("AbsentTo" & itemp),TextBox)
txt.Text = emailReader("From")
end if
if not (emailReader("Reason") is DBNull.Value) then
txt = DirectCast(Page.FindControl("AbsentReason" & itemp),TextBox)
txt.Text = emailReader("From")
end if
**********************************************************
I've done this before without any problems - what is this IConvertible
business?
Thanks,
Tom