Ask a Question related to ASP.NET General, Design and Development.
-
Helixpoint #1
Invalid attempt to read when no data is present.
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.
[url]http://www.helixpoint.com[/url]
[email]davef@helixpoint.com[/email]
Interested in Affordable Email Marketing?
Check out the HelixMailer at [url]http://www.helixpoint.com/helixmailer.asp[/url]
If you are interested in becoming a Reseller of HelixPoint products, contact
[email]davef@helixpoint.com[/email]
______________________
Helixpoint Guest
-
#39014 [NEW]: php.ini data.timezone invalid
From: deepseath at gmail dot com Operating system: Win2000 PHP version: 5.1.6 PHP Bug Type: IIS related Bug description: ... -
#38721 [Asn->Csd]: date_parse() invalid read
ID: 38721 Updated by: tony2001@php.net Reported By: tony2001@php.net -Status: Assigned +Status: ... -
Use the DataList Control to Present and Edit Data PART 2
Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI Imports System.Web.UI.WebControls Imports... -
Use the DataList Control to Present and Edit Data
I found some good information On "Use the DataList Control to Present and Edit Data" at this site... -
Invalid attempt to Read when reader is closed.
hi to all, i meet some problem and didn't find any recommendation to resolve it , do you have some idia , how i can resolve this problem, a lot of... -
Marina #2
Re: Invalid attempt to read when no data is present.
Looks like there were no rows returned. dr1.Read returned false.
"Helixpoint" <dave@helixpoint.com> wrote in message
news:OyEoEjBPDHA.2228@tk2msftngp13.phx.gbl...getting> Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID)
>
> ' Read first row from database
>
> dr1.Read()
>
> If IsDBNull(dr1("CATNUM")) Then '**************** This is where I amcontact> the error??????
>
> thecatnum = 0
>
> Else
>
> thecatnum = dr1("CATNUM")
>
> End If
>
>
> --
>
> ______________________
> David Fetrow
> HelixPoint LLC.
> [url]http://www.helixpoint.com[/url]
> [email]davef@helixpoint.com[/email]
>
> Interested in Affordable Email Marketing?
> Check out the HelixMailer at [url]http://www.helixpoint.com/helixmailer.asp[/url]
> If you are interested in becoming a Reseller of HelixPoint products,> [email]davef@helixpoint.com[/email]
> ______________________
>
>
Marina Guest
-
Helixpoint #3
Re: Invalid attempt to read when no data is present.
Not to be a jerk, but I figured that out.
"Marina" <zlatkinam@nospam.hotmail.com> wrote in message
news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...> Looks like there were no rows returned. dr1.Read returned false.
>
> "Helixpoint" <dave@helixpoint.com> wrote in message
> news:OyEoEjBPDHA.2228@tk2msftngp13.phx.gbl...> getting> > Dim dr1 As SqlDataReader = MachCodeListID.GetSingleMachCode(thecodesID)
> >
> > ' Read first row from database
> >
> > dr1.Read()
> >
> > If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am> contact> > the error??????
> >
> > thecatnum = 0
> >
> > Else
> >
> > thecatnum = dr1("CATNUM")
> >
> > End If
> >
> >
> > --
> >
> > ______________________
> > David Fetrow
> > HelixPoint LLC.
> > [url]http://www.helixpoint.com[/url]
> > [email]davef@helixpoint.com[/email]
> >
> > Interested in Affordable Email Marketing?
> > Check out the HelixMailer at [url]http://www.helixpoint.com/helixmailer.asp[/url]
> > If you are interested in becoming a Reseller of HelixPoint products,>> > [email]davef@helixpoint.com[/email]
> > ______________________
> >
> >
>
Helixpoint Guest
-
Marina #4
Re: Invalid attempt to read when no data is present.
If you figured out that no rows were returned, then what's the problem?
"Helixpoint" <dave@helixpoint.com> wrote in message
news:OT6UkqBPDHA.2788@TK2MSFTNGP10.phx.gbl...MachCodeListID.GetSingleMachCode(thecodesID)> Not to be a jerk, but I figured that out.
>
>
> "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...> > Looks like there were no rows returned. dr1.Read returned false.
> >
> > "Helixpoint" <dave@helixpoint.com> wrote in message
> > news:OyEoEjBPDHA.2228@tk2msftngp13.phx.gbl...> > > Dim dr1 As SqlDataReader =>> > getting> > >
> > > ' Read first row from database
> > >
> > > dr1.Read()
> > >
> > > If IsDBNull(dr1("CATNUM")) Then '**************** This is where I am> > contact> > > the error??????
> > >
> > > thecatnum = 0
> > >
> > > Else
> > >
> > > thecatnum = dr1("CATNUM")
> > >
> > > End If
> > >
> > >
> > > --
> > >
> > > ______________________
> > > David Fetrow
> > > HelixPoint LLC.
> > > [url]http://www.helixpoint.com[/url]
> > > [email]davef@helixpoint.com[/email]
> > >
> > > Interested in Affordable Email Marketing?
> > > Check out the HelixMailer at [url]http://www.helixpoint.com/helixmailer.asp[/url]
> > > If you are interested in becoming a Reseller of HelixPoint products,> >> > > [email]davef@helixpoint.com[/email]
> > > ______________________
> > >
> > >
> >
>
Marina Guest
-
Helixpoint #5
Re: Invalid attempt to read when no data is present.
I get an error when it checks for NULL???
"Marina" <zlatkinam@nospam.hotmail.com> wrote in message
news:unyL3sBPDHA.2228@tk2msftngp13.phx.gbl...[url]http://www.helixpoint.com/helixmailer.asp[/url]> If you figured out that no rows were returned, then what's the problem?
>
> "Helixpoint" <dave@helixpoint.com> wrote in message
> news:OT6UkqBPDHA.2788@TK2MSFTNGP10.phx.gbl...> MachCodeListID.GetSingleMachCode(thecodesID)> > Not to be a jerk, but I figured that out.
> >
> >
> > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> > news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...> > > Looks like there were no rows returned. dr1.Read returned false.
> > >
> > > "Helixpoint" <dave@helixpoint.com> wrote in message
> > > news:OyEoEjBPDHA.2228@tk2msftngp13.phx.gbl...
> > > > Dim dr1 As SqlDataReader => > > >
> > > > ' 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.
> > > > [url]http://www.helixpoint.com[/url]
> > > > [email]davef@helixpoint.com[/email]
> > > >
> > > > Interested in Affordable Email Marketing?
> > > > Check out the HelixMailer at>> >> > > > If you are interested in becoming a Reseller of HelixPoint products,
> > > contact
> > > > [email]davef@helixpoint.com[/email]
> > > > ______________________
> > > >
> > > >
> > >
> > >
> >
>
Helixpoint Guest
-
Marina #6
Re: Invalid attempt to read when no data is present.
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" <dave@helixpoint.com> wrote in message
news:%23zB3lvBPDHA.3836@tk2msftngp13.phx.gbl...am> I get an error when it checks for NULL???
>
>
>
> "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> news:unyL3sBPDHA.2228@tk2msftngp13.phx.gbl...> > If you figured out that no rows were returned, then what's the problem?
> >
> > "Helixpoint" <dave@helixpoint.com> wrote in message
> > news:OT6UkqBPDHA.2788@TK2MSFTNGP10.phx.gbl...> > MachCodeListID.GetSingleMachCode(thecodesID)> > > Not to be a jerk, but I figured that out.
> > >
> > >
> > > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> > > news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...
> > > > Looks like there were no rows returned. dr1.Read returned false.
> > > >
> > > > "Helixpoint" <dave@helixpoint.com> wrote in message
> > > > news:OyEoEjBPDHA.2228@tk2msftngp13.phx.gbl...
> > > > > Dim dr1 As SqlDataReader => > > > >
> > > > > ' Read first row from database
> > > > >
> > > > > dr1.Read()
> > > > >
> > > > > If IsDBNull(dr1("CATNUM")) Then '**************** This is where Iproducts,> [url]http://www.helixpoint.com/helixmailer.asp[/url]> > > > getting
> > > > > the error??????
> > > > >
> > > > > thecatnum = 0
> > > > >
> > > > > Else
> > > > >
> > > > > thecatnum = dr1("CATNUM")
> > > > >
> > > > > End If
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > ______________________
> > > > > David Fetrow
> > > > > HelixPoint LLC.
> > > > > [url]http://www.helixpoint.com[/url]
> > > > > [email]davef@helixpoint.com[/email]
> > > > >
> > > > > Interested in Affordable Email Marketing?
> > > > > Check out the HelixMailer at> > > > > If you are interested in becoming a Reseller of HelixPoint>> >> > > > contact
> > > > > [email]davef@helixpoint.com[/email]
> > > > > ______________________
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
>
Marina Guest
-
Marina #7
Re: Invalid attempt to read when no data is present.
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
<daphish@msn.com> wrote in message
news:h0kmfv4iodtvt10qe8n4tracbsjl42f7ao@4ax.com...am> 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" <dave@helixpoint.com>
> wrote:
>> >I get an error when it checks for NULL???
> >
> >
> >
> >"Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> >news:unyL3sBPDHA.2228@tk2msftngp13.phx.gbl...> >> If you figured out that no rows were returned, then what's the problem?
> >>
> >> "Helixpoint" <dave@helixpoint.com> wrote in message
> >> news:OT6UkqBPDHA.2788@TK2MSFTNGP10.phx.gbl...
> >> > Not to be a jerk, but I figured that out.
> >> >
> >> >
> >> > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> >> > news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...
> >> > > Looks like there were no rows returned. dr1.Read returned false.
> >> > >
> >> > > "Helixpoint" <dave@helixpoint.com> wrote in message
> >> > > news:OyEoEjBPDHA.2228@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 Iproducts,> >[url]http://www.helixpoint.com/helixmailer.asp[/url]> >> > > getting
> >> > > > the error??????
> >> > > >
> >> > > > thecatnum = 0
> >> > > >
> >> > > > Else
> >> > > >
> >> > > > thecatnum = dr1("CATNUM")
> >> > > >
> >> > > > End If
> >> > > >
> >> > > >
> >> > > > --
> >> > > >
> >> > > > ______________________
> >> > > > David Fetrow
> >> > > > HelixPoint LLC.
> >> > > > [url]http://www.helixpoint.com[/url]
> >> > > > [email]davef@helixpoint.com[/email]
> >> > > >
> >> > > > Interested in Affordable Email Marketing?
> >> > > > Check out the HelixMailer at> >> > > > If you are interested in becoming a Reseller of HelixPoint>> >> >> > > contact
> >> > > > [email]davef@helixpoint.com[/email]
> >> > > > ______________________
> >> > > >
> >> > > >
> >> > >
> >> > >
> >> >
> >> >
> >>
> >>
Marina Guest
-
daphish@msn.com #8
Re: Invalid attempt to read when no data is present.
oops my bad you could do it as
dr1("catnum") is nothing
On Thu, 26 Jun 2003 16:10:41 -0400, "Marina"
<zlatkinam@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
><daphish@msn.com> wrote in message
>news:h0kmfv4iodtvt10qe8n4tracbsjl42f7ao@4ax.com.. .>am>> 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" <dave@helixpoint.com>
>> wrote:
>>>> >I get an error when it checks for NULL???
>> >
>> >
>> >
>> >"Marina" <zlatkinam@nospam.hotmail.com> wrote in message
>> >news:unyL3sBPDHA.2228@tk2msftngp13.phx.gbl...
>> >> If you figured out that no rows were returned, then what's the problem?
>> >>
>> >> "Helixpoint" <dave@helixpoint.com> wrote in message
>> >> news:OT6UkqBPDHA.2788@TK2MSFTNGP10.phx.gbl...
>> >> > Not to be a jerk, but I figured that out.
>> >> >
>> >> >
>> >> > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
>> >> > news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...
>> >> > > Looks like there were no rows returned. dr1.Read returned false.
>> >> > >
>> >> > > "Helixpoint" <dave@helixpoint.com> wrote in message
>> >> > > news:OyEoEjBPDHA.2228@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>products,>> >> > > getting
>> >> > > > the error??????
>> >> > > >
>> >> > > > thecatnum = 0
>> >> > > >
>> >> > > > Else
>> >> > > >
>> >> > > > thecatnum = dr1("CATNUM")
>> >> > > >
>> >> > > > End If
>> >> > > >
>> >> > > >
>> >> > > > --
>> >> > > >
>> >> > > > ______________________
>> >> > > > David Fetrow
>> >> > > > HelixPoint LLC.
>> >> > > > [url]http://www.helixpoint.com[/url]
>> >> > > > [email]davef@helixpoint.com[/email]
>> >> > > >
>> >> > > > Interested in Affordable Email Marketing?
>> >> > > > Check out the HelixMailer at
>> >[url]http://www.helixpoint.com/helixmailer.asp[/url]
>> >> > > > If you are interested in becoming a Reseller of HelixPoint>>>>> >> > > contact
>> >> > > > [email]davef@helixpoint.com[/email]
>> >> > > > ______________________
>> >> > > >
>> >> > > >
>> >> > >
>> >> > >
>> >> >
>> >> >
>> >>
>> >>
>> >daphish@msn.com Guest
-
Marina #9
Re: Invalid attempt to read when no data is present.
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.
<daphish@msn.com> wrote in message
news:oklmfvgnfogaigdbpu50t8udcg4h4jnu6u@4ax.com...rows.> oops my bad you could do it as
> dr1("catnum") is nothing
>
> On Thu, 26 Jun 2003 16:10:41 -0400, "Marina"
> <zlatkinam@nospam.hotmail.com> wrote:
>> >There is no point to doing that. dr1.Read returned false - hence noproblem?> >Neither of these things will work. The structure needs to be
> >
> >If dr1.Read() Then
> >
> >If IsDbNull(dr1("Catnum") Then
> >....
> >End If
> >
> >End If
> ><daphish@msn.com> wrote in message
> >news:h0kmfv4iodtvt10qe8n4tracbsjl42f7ao@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" <dave@helixpoint.com>
> >> wrote:
> >>
> >> >I get an error when it checks for NULL???
> >> >
> >> >
> >> >
> >> >"Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> >> >news:unyL3sBPDHA.2228@tk2msftngp13.phx.gbl...
> >> >> If you figured out that no rows were returned, then what's thewhere I> >> >>
> >> >> "Helixpoint" <dave@helixpoint.com> wrote in message
> >> >> news:OT6UkqBPDHA.2788@TK2MSFTNGP10.phx.gbl...
> >> >> > Not to be a jerk, but I figured that out.
> >> >> >
> >> >> >
> >> >> > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
> >> >> > news:useiulBPDHA.2284@TK2MSFTNGP11.phx.gbl...
> >> >> > > Looks like there were no rows returned. dr1.Read returned false.
> >> >> > >
> >> >> > > "Helixpoint" <dave@helixpoint.com> wrote in message
> >> >> > > news:OyEoEjBPDHA.2228@tk2msftngp13.phx.gbl...
> >> >> > > > Dim dr1 As SqlDataReader =
> >> >> MachCodeListID.GetSingleMachCode(thecodesID)
> >> >> > > >
> >> >> > > > ' Read first row from database
> >> >> > > >
> >> >> > > > dr1.Read()
> >> >> > > >
> >> >> > > > If IsDBNull(dr1("CATNUM")) Then '**************** This is>> >am> >products,> >> >> > > getting
> >> >> > > > the error??????
> >> >> > > >
> >> >> > > > thecatnum = 0
> >> >> > > >
> >> >> > > > Else
> >> >> > > >
> >> >> > > > thecatnum = dr1("CATNUM")
> >> >> > > >
> >> >> > > > End If
> >> >> > > >
> >> >> > > >
> >> >> > > > --
> >> >> > > >
> >> >> > > > ______________________
> >> >> > > > David Fetrow
> >> >> > > > HelixPoint LLC.
> >> >> > > > [url]http://www.helixpoint.com[/url]
> >> >> > > > [email]davef@helixpoint.com[/email]
> >> >> > > >
> >> >> > > > Interested in Affordable Email Marketing?
> >> >> > > > Check out the HelixMailer at
> >> >[url]http://www.helixpoint.com/helixmailer.asp[/url]
> >> >> > > > If you are interested in becoming a Reseller of HelixPoint> >> >> >> > > contact
> >> >> > > > [email]davef@helixpoint.com[/email]
> >> >> > > > ______________________
> >> >> > > >
> >> >> > > >
> >> >> > >
> >> >> > >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >>
Marina Guest



Reply With Quote

