Click here to Skip to main content
15,936,932 members
Home / Discussions / C#
   

C#

 
GeneralRe: Inline If problem Pin
OriginalGriff29-May-09 1:16
mveOriginalGriff29-May-09 1:16 
GeneralRe: Inline If problem Pin
Pete O'Hanlon29-May-09 1:37
mvePete O'Hanlon29-May-09 1:37 
GeneralRe: Inline If problem Pin
stancrm29-May-09 1:48
stancrm29-May-09 1:48 
GeneralRe: Inline If problem Pin
Pete O'Hanlon29-May-09 1:56
mvePete O'Hanlon29-May-09 1:56 
GeneralRe: Inline If problem Pin
OriginalGriff29-May-09 21:41
mveOriginalGriff29-May-09 21:41 
AnswerRe: Inline If problem Pin
harold aptroot29-May-09 1:26
harold aptroot29-May-09 1:26 
GeneralRe: Inline If problem Pin
MarkB12329-May-09 1:58
MarkB12329-May-09 1:58 
GeneralRe: Inline If problem Pin
harold aptroot29-May-09 2:07
harold aptroot29-May-09 2:07 
With the code I suggested you could still get a nasty NullRef, but how about
var FocusVal = view.GetFocusedValue();
string strSequence = "";
if (FocusVal != null)
    strSequence = FocusVal.ToString();

Alternatively:
string strSequence = (view.GetFocusedValue() != null) ? view.GetFocusedValue().ToString() : "";

Would call GetFocusedValue twice though so only use if that's ok.

Or if GetFocusedValue returns a string:
string strSequence = view.GetFocusValue() ?? "";


edit: oh I missed the DBNull thing, well that might change things in ways unknown to me - I've never used database code.. Frown | :(



QuestionCrystal report datasource Pin
KIDYA29-May-09 0:57
KIDYA29-May-09 0:57 
AnswerRe: Crystal report datasource Pin
Nagy Vilmos29-May-09 1:19
professionalNagy Vilmos29-May-09 1:19 
GeneralRe: Crystal report datasource Pin
KIDYA29-May-09 1:24
KIDYA29-May-09 1:24 
GeneralRe: Crystal report datasource Pin
Nagy Vilmos29-May-09 1:40
professionalNagy Vilmos29-May-09 1:40 
QuestionRemove a special character from a file and save in same file. Pin
harishusharma29-May-09 0:53
harishusharma29-May-09 0:53 
AnswerRe: Remove a special character from a file and save in same file. Pin
stancrm29-May-09 1:10
stancrm29-May-09 1:10 
GeneralRe: Remove a special character from a file and save in same file. Pin
Nagy Vilmos29-May-09 1:14
professionalNagy Vilmos29-May-09 1:14 
GeneralRe: Remove a special character from a file and save in same file. Pin
harishusharma29-May-09 1:24
harishusharma29-May-09 1:24 
AnswerRe: Remove a special character from a file and save in same file. Pin
Nagy Vilmos29-May-09 1:12
professionalNagy Vilmos29-May-09 1:12 
GeneralRe: Remove a special character from a file and save in same file. Pin
harishusharma29-May-09 1:31
harishusharma29-May-09 1:31 
GeneralRe: Remove a special character from a file and save in same file. Pin
Nagy Vilmos29-May-09 1:43
professionalNagy Vilmos29-May-09 1:43 
AnswerRe: Remove a special character from a file and save in same file. Pin
Hoorfar29-May-09 22:15
Hoorfar29-May-09 22:15 
QuestionRe: Remove a special character from a file and save in same file. Pin
harishusharma9-Jul-09 6:22
harishusharma9-Jul-09 6:22 
Questionlogged in username in windows service Pin
P. S. Pundeer29-May-09 0:29
P. S. Pundeer29-May-09 0:29 
AnswerRe: logged in username in windows service Pin
Simon P Stevens29-May-09 0:46
Simon P Stevens29-May-09 0:46 
Questionenterprise libeary query Pin
sheemap29-May-09 0:22
sheemap29-May-09 0:22 
AnswerRe: enterprise libeary query Pin
Nagy Vilmos29-May-09 0:39
professionalNagy Vilmos29-May-09 0:39 

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.