Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID)
' Read first row from database
dr1.Read()
If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am getting
the error??????
thecatnum = 0
Else
thecatnum = dr1("CATNUM")
End If
--
______________________
David Fetrow
HelixPoint LLC. http://www.helixpoint.com da***@helixpoint.com
Interested in Affordable Email Marketing?
Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp
If you are interested in becoming a Reseller of HelixPoint products, contact da***@helixpoint.com
______________________ 8 35550
Looks like there were no rows returned. dr1.Read returned false.
"Helixpoint" <da**@helixpoint.com> wrote in message
news:Oy**************@tk2msftngp13.phx.gbl... Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID)
' Read first row from database
dr1.Read()
If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am
getting the error??????
thecatnum = 0
Else
thecatnum = dr1("CATNUM")
End If
--
______________________ David Fetrow HelixPoint LLC. http://www.helixpoint.com da***@helixpoint.com
Interested in Affordable Email Marketing? Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp If you are interested in becoming a Reseller of HelixPoint products,
contact da***@helixpoint.com ______________________
Not to be a jerk, but I figured that out.
"Marina" <zl*******@nospam.hotmail.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl... Looks like there were no rows returned. dr1.Read returned false.
"Helixpoint" <da**@helixpoint.com> wrote in message news:Oy**************@tk2msftngp13.phx.gbl... Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID)
' Read first row from database
dr1.Read()
If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am getting the error??????
thecatnum = 0
Else
thecatnum = dr1("CATNUM")
End If
--
______________________ David Fetrow HelixPoint LLC. http://www.helixpoint.com da***@helixpoint.com
Interested in Affordable Email Marketing? Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp If you are interested in becoming a Reseller of HelixPoint products, contact da***@helixpoint.com ______________________
If you figured out that no rows were returned, then what's the problem?
"Helixpoint" <da**@helixpoint.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl... Not to be a jerk, but I figured that out.
"Marina" <zl*******@nospam.hotmail.com> wrote in message news:us**************@TK2MSFTNGP11.phx.gbl... Looks like there were no rows returned. dr1.Read returned false.
"Helixpoint" <da**@helixpoint.com> wrote in message news:Oy**************@tk2msftngp13.phx.gbl... Dim dr1 As SqlDataReader =
MachCodeListID.GetSingleMachCode(thecodesID) ' Read first row from database
dr1.Read()
If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am getting the error??????
thecatnum = 0
Else
thecatnum = dr1("CATNUM")
End If
--
______________________ David Fetrow HelixPoint LLC. http://www.helixpoint.com da***@helixpoint.com
Interested in Affordable Email Marketing? Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp If you are interested in becoming a Reseller of HelixPoint products, contact da***@helixpoint.com ______________________
I get an error when it checks for NULL???
"Marina" <zl*******@nospam.hotmail.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl... If you figured out that no rows were returned, then what's the problem?
"Helixpoint" <da**@helixpoint.com> wrote in message news:OT**************@TK2MSFTNGP10.phx.gbl... Not to be a jerk, but I figured that out.
"Marina" <zl*******@nospam.hotmail.com> wrote in message news:us**************@TK2MSFTNGP11.phx.gbl... Looks like there were no rows returned. dr1.Read returned false.
"Helixpoint" <da**@helixpoint.com> wrote in message news:Oy**************@tk2msftngp13.phx.gbl... > Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID) > > ' Read first row from database > > dr1.Read() > > If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am getting > the error?????? > > thecatnum = 0 > > Else > > thecatnum = dr1("CATNUM") > > End If > > > -- > > ______________________ > David Fetrow > HelixPoint LLC. > http://www.helixpoint.com > da***@helixpoint.com > > Interested in Affordable Email Marketing? > Check out the HelixMailer at
http://www.helixpoint.com/helixmailer.asp > If you are interested in becoming a Reseller of HelixPoint products, contact > da***@helixpoint.com > ______________________ > >
If there was no row returned, there is now way to check if a column in that
row is null - because there is no row in the first place!!!
"Helixpoint" <da**@helixpoint.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... I get an error when it checks for NULL??? "Marina" <zl*******@nospam.hotmail.com> wrote in message news:un**************@tk2msftngp13.phx.gbl... If you figured out that no rows were returned, then what's the problem?
"Helixpoint" <da**@helixpoint.com> wrote in message news:OT**************@TK2MSFTNGP10.phx.gbl... Not to be a jerk, but I figured that out.
"Marina" <zl*******@nospam.hotmail.com> wrote in message news:us**************@TK2MSFTNGP11.phx.gbl... > Looks like there were no rows returned. dr1.Read returned false. > > "Helixpoint" <da**@helixpoint.com> wrote in message > news:Oy**************@tk2msftngp13.phx.gbl... > > Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID) > > > > ' Read first row from database > > > > dr1.Read() > > > > If IsDBNull(dr1("CATNUM")) Then '**************** This is where I
am > getting > > the error?????? > > > > thecatnum = 0 > > > > Else > > > > thecatnum = dr1("CATNUM") > > > > End If > > > > > > -- > > > > ______________________ > > David Fetrow > > HelixPoint LLC. > > http://www.helixpoint.com > > da***@helixpoint.com > > > > Interested in Affordable Email Marketing? > > Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp > > If you are interested in becoming a Reseller of HelixPoint
products, > contact > > da***@helixpoint.com > > ______________________ > > > > > >
There is no point to doing that. dr1.Read returned false - hence no rows.
Neither of these things will work. The structure needs to be
If dr1.Read() Then
If IsDbNull(dr1("Catnum") Then
.....
End If
End If
<da*****@msn.com> wrote in message
news:h0********************************@4ax.com... There is a difference between dbnull and the object being null. You also need to check if the object doesn't exists as well
if not dr1("Catnum") is vbnullstring orelse isdbnull(dr1("catnum") then
-dwayne
On Thu, 26 Jun 2003 15:47:53 -0400, "Helixpoint" <da**@helixpoint.com> wrote:
I get an error when it checks for NULL??? "Marina" <zl*******@nospam.hotmail.com> wrote in message news:un**************@tk2msftngp13.phx.gbl... If you figured out that no rows were returned, then what's the problem?
"Helixpoint" <da**@helixpoint.com> wrote in message news:OT**************@TK2MSFTNGP10.phx.gbl... > Not to be a jerk, but I figured that out. > > > "Marina" <zl*******@nospam.hotmail.com> wrote in message > news:us**************@TK2MSFTNGP11.phx.gbl... > > Looks like there were no rows returned. dr1.Read returned false. > > > > "Helixpoint" <da**@helixpoint.com> wrote in message > > news:Oy**************@tk2msftngp13.phx.gbl... > > > Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID) > > > > > > ' Read first row from database > > > > > > dr1.Read() > > > > > > If IsDBNull(dr1("CATNUM")) Then '**************** This is where I
am > > getting > > > the error?????? > > > > > > thecatnum = 0 > > > > > > Else > > > > > > thecatnum = dr1("CATNUM") > > > > > > End If > > > > > > > > > -- > > > > > > ______________________ > > > David Fetrow > > > HelixPoint LLC. > > > http://www.helixpoint.com > > > da***@helixpoint.com > > > > > > Interested in Affordable Email Marketing? > > > Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp > > > If you are interested in becoming a Reseller of HelixPoint
products, > > contact > > > da***@helixpoint.com > > > ______________________ > > > > > > > > > > > >
oops my bad you could do it as
dr1("catnum") is nothing
On Thu, 26 Jun 2003 16:10:41 -0400, "Marina"
<zl*******@nospam.hotmail.com> wrote: There is no point to doing that. dr1.Read returned false - hence no rows. Neither of these things will work. The structure needs to be
If dr1.Read() Then
If IsDbNull(dr1("Catnum") Then .... End If
End If <da*****@msn.com> wrote in message news:h0********************************@4ax.com.. . There is a difference between dbnull and the object being null. You also need to check if the object doesn't exists as well
if not dr1("Catnum") is vbnullstring orelse isdbnull(dr1("catnum") then
-dwayne
On Thu, 26 Jun 2003 15:47:53 -0400, "Helixpoint" <da**@helixpoint.com> wrote:
>I get an error when it checks for NULL??? > > > >"Marina" <zl*******@nospam.hotmail.com> wrote in message >news:un**************@tk2msftngp13.phx.gbl... >> If you figured out that no rows were returned, then what's the problem? >> >> "Helixpoint" <da**@helixpoint.com> wrote in message >> news:OT**************@TK2MSFTNGP10.phx.gbl... >> > Not to be a jerk, but I figured that out. >> > >> > >> > "Marina" <zl*******@nospam.hotmail.com> wrote in message >> > news:us**************@TK2MSFTNGP11.phx.gbl... >> > > Looks like there were no rows returned. dr1.Read returned false. >> > > >> > > "Helixpoint" <da**@helixpoint.com> wrote in message >> > > news:Oy**************@tk2msftngp13.phx.gbl... >> > > > Dim dr1 As SqlDataReader = >> MachCodeListID.GetSingleMachCode(thecodesID) >> > > > >> > > > ' Read first row from database >> > > > >> > > > dr1.Read() >> > > > >> > > > If IsDBNull(dr1("CATNUM")) Then '**************** This is where Iam >> > > getting >> > > > the error?????? >> > > > >> > > > thecatnum = 0 >> > > > >> > > > Else >> > > > >> > > > thecatnum = dr1("CATNUM") >> > > > >> > > > End If >> > > > >> > > > >> > > > -- >> > > > >> > > > ______________________ >> > > > David Fetrow >> > > > HelixPoint LLC. >> > > > http://www.helixpoint.com >> > > > da***@helixpoint.com >> > > > >> > > > Interested in Affordable Email Marketing? >> > > > Check out the HelixMailer at >http://www.helixpoint.com/helixmailer.asp >> > > > If you are interested in becoming a Reseller of HelixPointproducts, >> > > contact >> > > > da***@helixpoint.com >> > > > ______________________ >> > > > >> > > > >> > > >> > > >> > >> > >> >> >
No, my point is you could not do anything that would mean getting the column
value from the datareader.
The mere call to dr1("catnum") raises the error. There is no row - so no
column value for "catnum" - because there is no row!!
That's why the if statement for dr1.Read - to make sure there is a row
before you try to look at one of its columns.
<da*****@msn.com> wrote in message
news:ok********************************@4ax.com... oops my bad you could do it as dr1("catnum") is nothing
On Thu, 26 Jun 2003 16:10:41 -0400, "Marina" <zl*******@nospam.hotmail.com> wrote:
There is no point to doing that. dr1.Read returned false - hence no
rows.Neither of these things will work. The structure needs to be
If dr1.Read() Then
If IsDbNull(dr1("Catnum") Then .... End If
End If <da*****@msn.com> wrote in message news:h0********************************@4ax.com.. . There is a difference between dbnull and the object being null. You also need to check if the object doesn't exists as well
if not dr1("Catnum") is vbnullstring orelse isdbnull(dr1("catnum") then
-dwayne
On Thu, 26 Jun 2003 15:47:53 -0400, "Helixpoint" <da**@helixpoint.com> wrote:
>I get an error when it checks for NULL??? > > > >"Marina" <zl*******@nospam.hotmail.com> wrote in message >news:un**************@tk2msftngp13.phx.gbl... >> If you figured out that no rows were returned, then what's the
problem? >> >> "Helixpoint" <da**@helixpoint.com> wrote in message >> news:OT**************@TK2MSFTNGP10.phx.gbl... >> > Not to be a jerk, but I figured that out. >> > >> > >> > "Marina" <zl*******@nospam.hotmail.com> wrote in message >> > news:us**************@TK2MSFTNGP11.phx.gbl... >> > > Looks like there were no rows returned. dr1.Read returned false. >> > > >> > > "Helixpoint" <da**@helixpoint.com> wrote in message >> > > news:Oy**************@tk2msftngp13.phx.gbl... >> > > > Dim dr1 As SqlDataReader = >> MachCodeListID.GetSingleMachCode(thecodesID) >> > > > >> > > > ' Read first row from database >> > > > >> > > > dr1.Read() >> > > > >> > > > If IsDBNull(dr1("CATNUM")) Then '**************** This is
where Iam >> > > getting >> > > > the error?????? >> > > > >> > > > thecatnum = 0 >> > > > >> > > > Else >> > > > >> > > > thecatnum = dr1("CATNUM") >> > > > >> > > > End If >> > > > >> > > > >> > > > -- >> > > > >> > > > ______________________ >> > > > David Fetrow >> > > > HelixPoint LLC. >> > > > http://www.helixpoint.com >> > > > da***@helixpoint.com >> > > > >> > > > Interested in Affordable Email Marketing? >> > > > Check out the HelixMailer at >http://www.helixpoint.com/helixmailer.asp >> > > > If you are interested in becoming a Reseller of HelixPoint products, >> > > contact >> > > > da***@helixpoint.com >> > > > ______________________ >> > > > >> > > > >> > > >> > > >> > >> > >> >> > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brent Burkart |
last post by:
Below is the error I am receiving. I have checked SQL Profiler and it is
receiving the correct query which runs fine in Query Analyzer. Any ideas?
Server Error in '/lockinsheet' Application....
|
by: Matthew Louden |
last post by:
I want to read how many records in the table, and insert a record with id
field which increment the counter by 1. However, I had the following runtime
on Dim s As Integer = CInt(dr("t")). Since "t"...
|
by: Jerry |
last post by:
Below is ALL the code for all the databases...
Here's the problem:
I callup the aspx file in IE and the form comes up just fine. When I
select a person to update, I get the subject error. ...
|
by: phplasma |
last post by:
Hey,
I am currently attempting to implement a multi-threaded C# socket,
using SSL (.pem file/certification/private key combo) server using
Visual Studio C# Express.
I have successfully made...
|
by: MarkusR |
last post by:
If I run the stored proc in the Query Analyzer this works and I get the
expected result set back. However when I run it in my application I get
a results set of one row but when I try to access the...
|
by: divsTiw |
last post by:
I want to populate combo box with data from OracleDataReader
, but "Invalid attempt to read when no data is present."
is thrown.
there are two rows returned , then too why such error.
plzzz...
|
by: Naty |
last post by:
please can anybody help me? i'm trying to retrieve data from a db with visual studio 2005 and sql server 2000 in a web application, and the error "Invalid attempt to read when no data is present"...
|
by: Oodles Of Noodles |
last post by:
Hello fellow geeks
I have a problem in my database iVB .Net program that is generating 'Error:Invalid attempt to read when no data is present.'
The weird part is that when you call the page from...
|
by: =?Utf-8?B?ZWdzZGFy?= |
last post by:
How can I solve this error:
Invalid attempt to read when no data is present.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |