Click here to Skip to main content
16,010,488 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Dataset not saving Pin
plankmonkey28-Jul-07 5:47
plankmonkey28-Jul-07 5:47 
Questionhow we can embed vc++ code in vb.net Pin
cnu_sree28-Jul-07 0:16
cnu_sree28-Jul-07 0:16 
AnswerRe: how we can embed vc++ code in vb.net Pin
Paul Conrad28-Jul-07 5:47
professionalPaul Conrad28-Jul-07 5:47 
QuestionWhy VS designer doesn't work with sub classes ? Pin
Ky Nam27-Jul-07 21:38
Ky Nam27-Jul-07 21:38 
AnswerRe: Why VS designer doesn't work with sub classes ? Pin
Christian Graus27-Jul-07 21:42
protectorChristian Graus27-Jul-07 21:42 
GeneralRe: Why VS designer doesn't work with sub classes ? Pin
Ky Nam27-Jul-07 21:53
Ky Nam27-Jul-07 21:53 
GeneralRe: Why VS designer doesn't work with sub classes ? Pin
Dave Kreskowiak28-Jul-07 8:44
mveDave Kreskowiak28-Jul-07 8:44 
GeneralRe: Why VS designer doesn't work with sub classes ? Pin
Ky Nam28-Jul-07 14:22
Ky Nam28-Jul-07 14:22 
Questionhow to convert c# code into vb.net 2005 code Pin
eyes200727-Jul-07 21:35
eyes200727-Jul-07 21:35 
AnswerRe: how to convert c# code into vb.net 2005 code Pin
Christian Graus27-Jul-07 21:36
protectorChristian Graus27-Jul-07 21:36 
GeneralRe: how to convert c# code into vb.net 2005 code Pin
Paul Conrad28-Jul-07 13:36
professionalPaul Conrad28-Jul-07 13:36 
GeneralRe: how to convert c# code into vb.net 2005 code Pin
Dave Doknjas28-Jul-07 13:50
Dave Doknjas28-Jul-07 13:50 
GeneralRe: how to convert c# code into vb.net 2005 code Pin
Paul Conrad28-Jul-07 13:59
professionalPaul Conrad28-Jul-07 13:59 
AnswerRe: how to convert c# code into vb.net 2005 code Pin
Ky Nam27-Jul-07 21:41
Ky Nam27-Jul-07 21:41 
AnswerRe: how to convert c# code into vb.net 2005 code Pin
Kevin McFarlane28-Jul-07 0:49
Kevin McFarlane28-Jul-07 0:49 
AnswerRe: how to convert c# code into vb.net 2005 code Pin
Dave Doknjas28-Jul-07 12:47
Dave Doknjas28-Jul-07 12:47 
QuestionObject reference not set to an instance of an object [modified] Pin
ASPnoob27-Jul-07 19:36
ASPnoob27-Jul-07 19:36 
AnswerRe: Object reference not set to an instance of an object Pin
Christian Graus27-Jul-07 19:54
protectorChristian Graus27-Jul-07 19:54 
AnswerRe: Object reference not set to an instance of an object Pin
Paul Conrad27-Jul-07 19:58
professionalPaul Conrad27-Jul-07 19:58 
GeneralRe: Object reference not set to an instance of an object Pin
ASPnoob27-Jul-07 20:49
ASPnoob27-Jul-07 20:49 
GeneralRe: Object reference not set to an instance of an object Pin
Paul Conrad27-Jul-07 21:08
professionalPaul Conrad27-Jul-07 21:08 
GeneralRe: Object reference not set to an instance of an object Pin
ASPnoob27-Jul-07 21:30
ASPnoob27-Jul-07 21:30 
GeneralRe: Object reference not set to an instance of an object Pin
Christian Graus27-Jul-07 21:35
protectorChristian Graus27-Jul-07 21:35 
AnswerRe: Object reference not set to an instance of an object Pin
Christian Graus27-Jul-07 21:40
protectorChristian Graus27-Jul-07 21:40 
ASPnoob wrote:
For i = 0 To CarsNamesLBox.Items.Count - 1



ASPnoob wrote:
SELECT CarID, Model From CarsTB where Make = 'CarsNamesLBox.Items(i).Text'",


Oh, I didn't even spot that ( I think the other poster did ).

SELECT CarID, Model From CarsTB where Make = '" & CarsNamesLBox.Items(i).Text & "'",

I am pretty sure this is what the code looked like when I first saw it, actually. If you further mangle your code, post it in a reply, not by editing the post. Change it to

SELECT CarID, Model From CarsTB where Make = '" & CarsNamesLBox.SelectedItem.Text & "'"

add a check to see if CarsNamesLBox.SelectedItem = Nothing, and get rid of the loop. That's what I told you to do in the first place. Beyond that, if you're getting this exception, you need to go into the debugger, set a breakpoint on the line, and type things like CarsNamesLBox and CarsNamesLBox.SelectedItem and CarsNamesLBox.SelectedItem.Text, until you find the property that has a value of Nothing, which is what is causing your error.

And, in future, be aware that things can be uninitialised, and write code that checks, so it can fail gracefully.




Christian Graus - Microsoft MVP - C++

"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

AnswerMessage formatting question (expires on sunday) Pin
Luc Pattyn27-Jul-07 23:24
sitebuilderLuc Pattyn27-Jul-07 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.