Click here to Skip to main content
15,903,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionExcel -- Using oledb -- getting dbnull when it's not Pin
nlarson1114-Feb-07 5:18
nlarson1114-Feb-07 5:18 
AnswerRe: Excel -- Using oledb -- getting dbnull when it's not Pin
Marcus J. Smith14-Feb-07 5:40
professionalMarcus J. Smith14-Feb-07 5:40 
GeneralRe: Excel -- Using oledb -- getting dbnull when it's not Pin
nlarson1114-Feb-07 5:54
nlarson1114-Feb-07 5:54 
Questionadding button in dataGrid Pin
costavo14-Feb-07 4:05
costavo14-Feb-07 4:05 
AnswerRe: adding button in dataGrid [modified] Pin
Marcus J. Smith14-Feb-07 4:06
professionalMarcus J. Smith14-Feb-07 4:06 
QuestionHow to extract a zip using vb.net Pin
Navas.M14-Feb-07 3:27
Navas.M14-Feb-07 3:27 
AnswerRe: How to extract a zip using vb.net Pin
andyharman14-Feb-07 6:44
professionalandyharman14-Feb-07 6:44 
QuestionRedundancy seems to be my game to avoid Null Reference and Index Out of Range Exceptions - HELP! Pin
Marcus J. Smith14-Feb-07 2:16
professionalMarcus J. Smith14-Feb-07 2:16 
When it comes to coding I think I am too paranoid about input and I would like some feedback to help me rid myself of the obsession (Im not talking about input validation but rather Null Reference Exceptions or formatting strings that need to be non-blank).

I almost always perform 2 checks on a string and include a trim no matter what.

If strValue IsNot Nothing AndAlso strValue.Trim <> "" Then

I have read some things saying that I should probably use strValue.Length > 0. What I am curious about is should I always perform the .Trim or is if strValue = " " considered 0 length?

Also on DB items I usually perform 3 checks.

If dr.Item("ColumnName") IsNot DBNull AndAlso dr.Item("ColumnName") IsNot Nothing AndAlso dr.Item("ColumnName").ToString.Trim <> "" Then

How much of that is necessary?

This may seem ridiculous but I guess Im tired of doing so much if I dont need to.

Thanks!
Cleako
AnswerRe: Redundancy seems to be my game to avoid Null Reference and Index Out of Range Exceptions - HELP! Pin
Colin Angus Mackay14-Feb-07 5:02
Colin Angus Mackay14-Feb-07 5:02 
Questionhelp for MenuItem for VB.Net Compact Framework Pin
danaelx14-Feb-07 0:37
danaelx14-Feb-07 0:37 
Questionwhat is handle in .net Pin
saravanaks13-Feb-07 23:59
saravanaks13-Feb-07 23:59 
AnswerRe: what is handle in .net Pin
Christian Graus14-Feb-07 0:35
protectorChristian Graus14-Feb-07 0:35 
AnswerRe: what is handle in .net Pin
Thomas Stockwell15-Feb-07 14:26
professionalThomas Stockwell15-Feb-07 14:26 
Questionhow could I use the values of the dataGrid Pin
costavo13-Feb-07 23:52
costavo13-Feb-07 23:52 
AnswerRe: how could I use the values of the dataGrid Pin
Marcus J. Smith14-Feb-07 2:09
professionalMarcus J. Smith14-Feb-07 2:09 
AnswerRe: how could I use the values of the dataGrid Pin
Rahul Appu14-Feb-07 2:12
Rahul Appu14-Feb-07 2:12 
GeneralRe: how could I use the values of the dataGrid Pin
costavo14-Feb-07 2:19
costavo14-Feb-07 2:19 
QuestionRe: how could I use the values of the dataGrid Pin
costavo14-Feb-07 2:32
costavo14-Feb-07 2:32 
AnswerRe: how could I use the values of the dataGrid Pin
Marcus J. Smith14-Feb-07 2:52
professionalMarcus J. Smith14-Feb-07 2:52 
QuestionOpen Directory Pin
lone_wolf35113-Feb-07 23:34
lone_wolf35113-Feb-07 23:34 
AnswerRe: Open Directory Pin
Christian Graus14-Feb-07 0:39
protectorChristian Graus14-Feb-07 0:39 
GeneralRe: Open Directory Pin
lone_wolf35114-Feb-07 0:45
lone_wolf35114-Feb-07 0:45 
AnswerRe: Open Directory Pin
WestSideRailways14-Feb-07 7:33
WestSideRailways14-Feb-07 7:33 
GeneralRe: Open Directory Pin
Dave Kreskowiak14-Feb-07 16:14
mveDave Kreskowiak14-Feb-07 16:14 
GeneralRe: Open Directory Pin
WestSideRailways14-Feb-07 21:45
WestSideRailways14-Feb-07 21:45 

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.