473,378 Members | 1,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Unable to set up emailReader

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
Nov 19 '05 #1
1 1199
"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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 found the problem. I had been passing ApplicantProfileID as a parameter
value. The problem is that ApplicantProfileID is a TextBox and you can't
use a TextBox as a value.

The statement should have been:

.Add("@ApplicantProfileID",SqlDbType.Bigint).value =
ApplicantProfileID.Text

Tom
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
0
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
3
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
1
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
4
by: =?Utf-8?B?SnVhbiBEZW50?= | last post by:
Hi, I am getting the following in a VC++ EXE (using VS2005) that links several C++ DLLs and uses MFC and ATL, when I try to start it under the debugger: ------- 'Exactus.UX.Studio.v1.exe':...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.