Click here to Skip to main content
15,887,776 members
Home / Discussions / C#
   

C#

 
QuestionVSTO word addin Pin
adkalavadia14-Jun-11 21:04
adkalavadia14-Jun-11 21:04 
AnswerRe: VSTO word addin Pin
Roger Wright15-Jun-11 21:39
professionalRoger Wright15-Jun-11 21:39 
Questionhow to load and display two images in c# Pin
ankushjain14-Jun-11 20:56
ankushjain14-Jun-11 20:56 
AnswerRe: how to load and display two images in c# Pin
Richard MacCutchan14-Jun-11 22:10
mveRichard MacCutchan14-Jun-11 22:10 
AnswerRe: how to load and display two images in c# Pin
BobJanova15-Jun-11 0:53
BobJanova15-Jun-11 0:53 
QuestionWhat is this line? Pin
AmbiguousName14-Jun-11 20:07
AmbiguousName14-Jun-11 20:07 
AnswerRe: What is this line? Pin
Mycroft Holmes14-Jun-11 20:12
professionalMycroft Holmes14-Jun-11 20:12 
AnswerRe: What is this line? PinPopular
V.14-Jun-11 20:30
professionalV.14-Jun-11 20:30 
to elaborate on Mycroft's reply. This is often used when talking to the database. Suppose you have a column that contains a number, but the column can be null. In that case you would need to check if the value was DBNUll.Value and if so convert your variable (that maps to that column) to -1 or 0 or something. When using the ? construct you don't need to convert it and can directly map the variable to the database column. Some goes if you want to write a value to that column.

The ? is an 'override' so you can put null values in non-nullable variables (int, double, DateTime, ... but not strings, they can be null)

Hope this helps.

[EDIT]PS: don't be afraid to use it, but don't use it if you don't have to.[\EDIT]
V.

AnswerRe: What is this line? Pin
Roger Wright14-Jun-11 20:32
professionalRoger Wright14-Jun-11 20:32 
GeneralRe: What is this line? Pin
Łukasz Nowakowski14-Jun-11 21:07
Łukasz Nowakowski14-Jun-11 21:07 
GeneralRe: What is this line? Pin
Pete O'Hanlon14-Jun-11 21:17
mvePete O'Hanlon14-Jun-11 21:17 
GeneralRe: What is this line? Pin
Łukasz Nowakowski14-Jun-11 21:23
Łukasz Nowakowski14-Jun-11 21:23 
GeneralRe: What is this line? Pin
Roger Wright14-Jun-11 21:25
professionalRoger Wright14-Jun-11 21:25 
GeneralRe: What is this line? Pin
RobCroll14-Jun-11 22:56
RobCroll14-Jun-11 22:56 
GeneralRe: What is this line? Pin
BobJanova15-Jun-11 0:41
BobJanova15-Jun-11 0:41 
GeneralHow can I add application configuration file in C# project? Pin
bulbul01198914-Jun-11 18:48
bulbul01198914-Jun-11 18:48 
GeneralRe: How can I add application configuration file in C# project? Pin
Roger Wright14-Jun-11 19:54
professionalRoger Wright14-Jun-11 19:54 
QuestionMessage Removed Pin
14-Jun-11 18:38
nehajain1214-Jun-11 18:38 
AnswerRe: Dwnload file in c# Pin
walterhevedeich14-Jun-11 19:02
professionalwalterhevedeich14-Jun-11 19:02 
GeneralRe: Dwnload file in c# Pin
Richard MacCutchan16-Jun-11 3:43
mveRichard MacCutchan16-Jun-11 3:43 
AnswerRe: Dwnload file in c# Pin
Ravi Sant20-Jun-11 1:25
Ravi Sant20-Jun-11 1:25 
QuestionDeny access to a datatable while in use from another object Pin
MAW3014-Jun-11 18:10
MAW3014-Jun-11 18:10 
AnswerRe: Deny access to a datatable while in use from another object Pin
Richard Andrew x6414-Jun-11 20:12
professionalRichard Andrew x6414-Jun-11 20:12 
AnswerRe: Deny access to a datatable while in use from another object Pin
jschell15-Jun-11 9:04
jschell15-Jun-11 9:04 
QuestionParsing HTML of some website using C Sharp. Pin
shivamkalra14-Jun-11 15:35
shivamkalra14-Jun-11 15:35 

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.