Click here to Skip to main content
15,795,054 members
Home / Discussions / C#
   

C#

 
QuestionHow do I open a flush from the resource folder in C # Pin
Member 1362111717-Jan-18 12:46
Member 1362111717-Jan-18 12:46 
AnswerRe: How do I open a flush from the resource folder in C # Pin
OriginalGriff17-Jan-18 21:10
mvaOriginalGriff17-Jan-18 21:10 
GeneralRe: How do I open a flush from the resource folder in C # Pin
Member 1362111718-Jan-18 5:50
Member 1362111718-Jan-18 5:50 
GeneralRe: How do I open a flush from the resource folder in C # Pin
Member 1362111718-Jan-18 6:56
Member 1362111718-Jan-18 6:56 
AnswerRe: How do I open a flush from the resource folder in C # Pin
Pete O'Hanlon17-Jan-18 22:00
subeditorPete O'Hanlon17-Jan-18 22:00 
GeneralRe: How do I open a flush from the resource folder in C # Pin
Member 1362111718-Jan-18 5:52
Member 1362111718-Jan-18 5:52 
QuestionHow to generate auto no for property Pin
Mou_kol16-Jan-18 23:08
Mou_kol16-Jan-18 23:08 
AnswerRe: How to generate auto no for property Pin
OriginalGriff17-Jan-18 0:10
mvaOriginalGriff17-Jan-18 0:10 
Assuming this is a one-time value (i.e. your data isn't persisted in a database or similar), add a class level static integer to your class, and initialize it to one:
C#
private static int nextValue = 1;
Then in your class constructor, you set the Id value to the static variable, and increment:
C#
public PersonalDetail()
   {
   Id = nextValue++;
   }
Do note that this is not inherently thread safe, so if you need a complex program you need to look at more robust schemes - but then you are probably going to be using a database of some form to store your data instead of hardcoding it, and all databases provide mechanisms for supporting unique values for each row so that should be a concern.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

AnswerRe: How to generate auto no for property Pin
Jochen Arndt17-Jan-18 0:24
professionalJochen Arndt17-Jan-18 0:24 
AnswerRe: How to generate auto no for property Pin
Gerry Schmitz17-Jan-18 10:30
mveGerry Schmitz17-Jan-18 10:30 
AnswerRe: How to generate auto no for property Pin
BillWoodruff20-Jan-18 16:03
professionalBillWoodruff20-Jan-18 16:03 
GeneralRe: How to generate auto no for property Pin
Mou_kol23-Jan-18 21:59
Mou_kol23-Jan-18 21:59 
GeneralRe: How to generate auto no for property Pin
BillWoodruff24-Jan-18 0:51
professionalBillWoodruff24-Jan-18 0:51 
SuggestionHow do I run adb or fastboot command in the folder location? Pin
Member 1362111716-Jan-18 18:29
Member 1362111716-Jan-18 18:29 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Richard MacCutchan16-Jan-18 23:08
mveRichard MacCutchan16-Jan-18 23:08 
PraiseRe: How do I run adb or fastboot command in the folder location? Pin
Member 1362111717-Jan-18 8:36
Member 1362111717-Jan-18 8:36 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Pete O'Hanlon17-Jan-18 9:59
subeditorPete O'Hanlon17-Jan-18 9:59 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Richard MacCutchan18-Jan-18 0:26
mveRichard MacCutchan18-Jan-18 0:26 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Member 1362111717-Jan-18 12:54
Member 1362111717-Jan-18 12:54 
QuestionError: Object reference not set to an instance of an object in C# Pin
Member 1030297116-Jan-18 14:52
Member 1030297116-Jan-18 14:52 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
OriginalGriff16-Jan-18 22:12
mvaOriginalGriff16-Jan-18 22:12 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Member 1030297117-Jan-18 3:47
Member 1030297117-Jan-18 3:47 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Pete O'Hanlon17-Jan-18 3:55
subeditorPete O'Hanlon17-Jan-18 3:55 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
Ralf Meier16-Jan-18 22:14
professionalRalf Meier16-Jan-18 22:14 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
V.16-Jan-18 23:06
professionalV.16-Jan-18 23:06 

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.