Click here to Skip to main content
16,004,927 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Displaying Binary Image to PICTUREBOX Pin
thealca14-Mar-06 2:10
thealca14-Mar-06 2:10 
AnswerRe: Displaying Binary Image to PICTUREBOX Pin
albCode14-Mar-06 3:20
albCode14-Mar-06 3:20 
GeneralRe: Displaying Binary Image to PICTUREBOX Pin
Vasudevan Deepak Kumar14-Mar-06 4:09
Vasudevan Deepak Kumar14-Mar-06 4:09 
GeneralRe: Displaying Binary Image to PICTUREBOX Pin
albCode14-Mar-06 4:27
albCode14-Mar-06 4:27 
Questionnull reference, object reference not set to instance of object Pin
uglyeyes14-Mar-06 1:34
uglyeyes14-Mar-06 1:34 
AnswerRe: null reference, object reference not set to instance of object Pin
Dave Kreskowiak14-Mar-06 2:26
mveDave Kreskowiak14-Mar-06 2:26 
GeneralRe: null reference, object reference not set to instance of object Pin
uglyeyes14-Mar-06 2:44
uglyeyes14-Mar-06 2:44 
AnswerRe: null reference, object reference not set to instance of object Pin
J4amieC14-Mar-06 2:33
J4amieC14-Mar-06 2:33 
A few suggestions, in no particular order.

1) If you asre getting an exception in code, you have done the right thing by showing us the code, however you have not indicated where, in this code, the exception is being raised.

That said, the good ol' "Object reference not set to an instance of an object" exception is the most cut-and-dry there is. It means that somewhere you have tried to access a property or method of an object without first instantiating the object.

A quick scan shows: objConn.Open() is called, but that object has not (as far as I can tell) been instantiated.

2) You should not be creating your SQL Queries in this way - read about Sql Injection attacks[^] for more info. Also note that using ADO.NET parameters would remove the need to keep calling that Replace(textfield,"'","''") hack.

3) Using separate queries for looking up a username and an email address is unnecessary network overhead. Using a dataset to retrieve just one value is unnecessary local overhead. A better way would be a) Use one query to determine if username OR email exists in the db and simply return a boolean(or single value indicating problem if you require) b) Use the command's ExecuteScalar[^] method to return a single value, rather than a dataset, which should be used when you really do need a disconnected table on the client.

-- modified at 8:36 Tuesday 14th March, 2006
GeneralRe: null reference, object reference not set to instance of object Pin
uglyeyes14-Mar-06 18:24
uglyeyes14-Mar-06 18:24 
Questioncall Keyup probelm Pin
Jeeva Jose14-Mar-06 0:39
Jeeva Jose14-Mar-06 0:39 
AnswerRe: call Keyup probelm Pin
Chatura Dilan14-Mar-06 14:46
Chatura Dilan14-Mar-06 14:46 
Questionvb application Pin
Dralha14-Mar-06 0:30
Dralha14-Mar-06 0:30 
QuestionBeep and sound Pin
Castello0713-Mar-06 23:19
Castello0713-Mar-06 23:19 
AnswerRe: Beep and sound Pin
Vasudevan Deepak Kumar14-Mar-06 2:35
Vasudevan Deepak Kumar14-Mar-06 2:35 
GeneralRe: Beep and sound Pin
Castello0714-Mar-06 3:36
Castello0714-Mar-06 3:36 
Questioncollecting drive info service in VB.NET Pin
Daniel Loczi13-Mar-06 20:31
Daniel Loczi13-Mar-06 20:31 
AnswerRe: collecting drive info service in VB.NET Pin
albCode13-Mar-06 21:17
albCode13-Mar-06 21:17 
AnswerRe: collecting drive info service in VB.NET Pin
Vasudevan Deepak Kumar14-Mar-06 2:39
Vasudevan Deepak Kumar14-Mar-06 2:39 
QuestionRe: collecting drive info service in VB.NET Pin
Daniel Loczi17-Mar-06 21:09
Daniel Loczi17-Mar-06 21:09 
Questionnotepad application Pin
deborai13-Mar-06 20:05
deborai13-Mar-06 20:05 
AnswerRe: notepad application Pin
Vasudevan Deepak Kumar14-Mar-06 2:38
Vasudevan Deepak Kumar14-Mar-06 2:38 
Questionserch Pin
babyfam13-Mar-06 19:38
babyfam13-Mar-06 19:38 
AnswerRe: serch Pin
Dave Kreskowiak14-Mar-06 2:29
mveDave Kreskowiak14-Mar-06 2:29 
GeneralRe: serch Pin
Vasudevan Deepak Kumar14-Mar-06 2:40
Vasudevan Deepak Kumar14-Mar-06 2:40 
Questiondatabase search Pin
babyfam13-Mar-06 19:30
babyfam13-Mar-06 19:30 

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.