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

C#

 
SuggestionHow do I run adb or fastboot command in the folder location? Pin
Member 1362111716-Jan-18 17:29
Member 1362111716-Jan-18 17:29 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Richard MacCutchan16-Jan-18 22:08
mveRichard MacCutchan16-Jan-18 22:08 
PraiseRe: How do I run adb or fastboot command in the folder location? Pin
Member 1362111717-Jan-18 7:36
Member 1362111717-Jan-18 7:36 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Pete O'Hanlon17-Jan-18 8:59
mvePete O'Hanlon17-Jan-18 8:59 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Richard MacCutchan17-Jan-18 23:26
mveRichard MacCutchan17-Jan-18 23:26 
GeneralRe: How do I run adb or fastboot command in the folder location? Pin
Member 1362111717-Jan-18 11:54
Member 1362111717-Jan-18 11:54 
QuestionError: Object reference not set to an instance of an object in C# Pin
Member 1030297116-Jan-18 13:52
Member 1030297116-Jan-18 13:52 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
OriginalGriff16-Jan-18 21:12
mveOriginalGriff16-Jan-18 21:12 
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.

Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which means that there is no instance of a class in the variable.
It's a bit like a pocket: you have a pocket in your shirt, which you use to hold a pen. If you reach into the pocket and find there isn't a pen there, you can't sign your name on a piece of paper - and you will get very funny looks if you try! The empty pocket is giving you a null value (no pen here!) so you can't do anything that you would normally do once you retrieved your pen. Why is it empty? That's the question - it may be that you forgot to pick up your pen when you left the house this morning, or possibly you left the pen in the pocket of yesterdays shirt when you took it off last night.

We can't tell, because we weren't there, and even more importantly, we can't even see your shirt, much less what is in the pocket!

Back to computers, and you have done the same thing, somehow - and we can't see your code, much less run it and find out what contains null when it shouldn't.
But you can - and Visual Studio will help you here. Run your program in the debugger and when it fails, VS will show you the line it found the problem on. You can then start looking at the various parts of it to see what value is null and start looking back through your code to find out why. So put a breakpoint at the beginning of the method containing the error line, and run your program from the start again. This time, VS will stop before the error, and let you examine what is going on by stepping through the code looking at your values.

But we can't do that - we don't have your code, we don't know how to use it if we did have it, we don't have your data. So try it - and see how much information you can find out!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Member 1030297117-Jan-18 2:47
Member 1030297117-Jan-18 2:47 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Pete O'Hanlon17-Jan-18 2:55
mvePete O'Hanlon17-Jan-18 2:55 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
Ralf Meier16-Jan-18 21:14
mveRalf Meier16-Jan-18 21:14 
AnswerRe: Error: Object reference not set to an instance of an object in C# Pin
V.16-Jan-18 22:06
professionalV.16-Jan-18 22:06 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Member 1030297117-Jan-18 3:00
Member 1030297117-Jan-18 3:00 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
F-ES Sitecore17-Jan-18 4:05
professionalF-ES Sitecore17-Jan-18 4:05 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
Pete O'Hanlon17-Jan-18 4:41
mvePete O'Hanlon17-Jan-18 4:41 
GeneralRe: Error: Object reference not set to an instance of an object in C# Pin
V.18-Jan-18 3:25
professionalV.18-Jan-18 3:25 
QuestionException raised at wpf designer level Pin
abboudi_ammar16-Jan-18 7:35
abboudi_ammar16-Jan-18 7:35 
QuestionHow to convert a query to lambda based Pin
Mou_kol16-Jan-18 1:43
Mou_kol16-Jan-18 1:43 
AnswerRe: How to convert a query to lambda based Pin
OriginalGriff16-Jan-18 1:52
mveOriginalGriff16-Jan-18 1:52 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol16-Jan-18 3:50
Mou_kol16-Jan-18 3:50 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol24-Jan-18 0:26
Mou_kol24-Jan-18 0:26 
GeneralRe: How to convert a query to lambda based Pin
OriginalGriff24-Jan-18 0:44
mveOriginalGriff24-Jan-18 0:44 
AnswerRe: How to convert a query to lambda based Pin
Richard Deeming16-Jan-18 3:03
mveRichard Deeming16-Jan-18 3:03 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol16-Jan-18 3:50
Mou_kol16-Jan-18 3:50 
GeneralRe: How to convert a query to lambda based Pin
Mou_kol24-Jan-18 0:35
Mou_kol24-Jan-18 0: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.