View Single Post
  #10 (permalink)  
Old March 3rd, 2009, 12:25 PM
gbianchi gbianchi is offline
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi

the correct line is
label1.text = dr.getstring(dr.getordinal("HomeLeft"));
This function fail is the value of the data is null, so check for null values before doing this.

You have it twice because getstring (or value, or XXX) require the number of the column. Because it's suicidal to supply the number by itself (maybe you know it, but hey, another can change the code) then you suply it with getordinal that will return the number for the column name you are suppling.


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
================================================== =========
I know that CVS was evil, and now i got the
================================================== =========