Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
GeneralRe: PInvoke, varaible length arrays Pin
DaveyM6914-Aug-09 12:20
professionalDaveyM6914-Aug-09 12:20 
GeneralRe: PInvoke, varaible length arrays [modified] Pin
Hristo-Bojilov14-Aug-09 12:33
Hristo-Bojilov14-Aug-09 12:33 
QuestionUpdate db table Linq Pin
spankyleo12314-Aug-09 10:05
spankyleo12314-Aug-09 10:05 
AnswerCross posted from the LINQ forum Pin
Pete O'Hanlon14-Aug-09 10:33
mvePete O'Hanlon14-Aug-09 10:33 
GeneralRe: Cross posted from the LINQ forum Pin
spankyleo12314-Aug-09 10:39
spankyleo12314-Aug-09 10:39 
GeneralRe: Cross posted from the LINQ forum Pin
Pete O'Hanlon14-Aug-09 10:54
mvePete O'Hanlon14-Aug-09 10:54 
QuestionError handling for WMI queries [Solved] Pin
eeffoc4214-Aug-09 9:32
eeffoc4214-Aug-09 9:32 
AnswerRe: Error handling for WMI queries Pin
Saksida Bojan14-Aug-09 9:47
Saksida Bojan14-Aug-09 9:47 
eeffoc42 wrote:
Would it be best to use a try catch?

That is one way and the best way. There coud be error hundling as returning result, but throwing expection has its own uses. If You don't have unhandled expection the program will have a poped up a form or send it to debbuger if attached.

eeffoc42 wrote:
If so would I need to write it in for every property value?

That is up to you and based on a case. If property has some limits like value is too low then yes.

I do not know what Expection is thrown, here is some examples:

<br />
try<br />
{<br />
            XmlReaderSettings xrs = new XmlReaderSettings();<br />
            xrs.IgnoreWhitespace = true;<br />
            xrs.IgnoreComments = true;<br />
            String nonExsistingFile = "C:\Haha.txt";<br />
<br />
            XmlReader reader = XmlReader.Create(nonExsistingFile , xrs);<br />
<br />
}<br />
catch (FileNotFoundException ex)<br />
{<br />
            // Your code to handle that expection<br />
}<br />


If you have your own class, and if it doesn't throw exception, those try catch woudn't have any effect.
If you are looking custom Exception look here:
http://blog.gurock.com/articles/creating-custom-exceptions-in-dotnet/[^]
AnswerRe: Error handling for WMI queries Pin
Luc Pattyn14-Aug-09 9:48
sitebuilderLuc Pattyn14-Aug-09 9:48 
AnswerRe: Error handling for WMI queries [modified] Pin
Hristo-Bojilov14-Aug-09 10:18
Hristo-Bojilov14-Aug-09 10:18 
QuestionComparing files on another computer. Pin
murktinez14-Aug-09 8:03
murktinez14-Aug-09 8:03 
AnswerRe: Comparing files on another computer. Pin
Saksida Bojan14-Aug-09 8:27
Saksida Bojan14-Aug-09 8:27 
GeneralRe: Comparing files on another computer. Pin
murktinez14-Aug-09 21:00
murktinez14-Aug-09 21:00 
GeneralRe: Comparing files on another computer. Pin
Saksida Bojan14-Aug-09 21:42
Saksida Bojan14-Aug-09 21:42 
QuestionWeb Service Pin
#realJSOP14-Aug-09 6:46
professional#realJSOP14-Aug-09 6:46 
AnswerRe: Web Service Pin
Ennis Ray Lynch, Jr.14-Aug-09 8:18
Ennis Ray Lynch, Jr.14-Aug-09 8:18 
AnswerRe: Web Service Pin
Mycroft Holmes14-Aug-09 17:40
professionalMycroft Holmes14-Aug-09 17:40 
Questionshow time country wise Pin
smiley_jatin14-Aug-09 5:05
smiley_jatin14-Aug-09 5:05 
AnswerRe: show time country wise Pin
Saksida Bojan14-Aug-09 5:17
Saksida Bojan14-Aug-09 5:17 
AnswerRe: show time country wise Pin
0x3c014-Aug-09 5:37
0x3c014-Aug-09 5:37 
Questionstring versus String ! Pin
_Q12_14-Aug-09 5:01
_Q12_14-Aug-09 5:01 
AnswerRe: string versus String ! Pin
0x3c014-Aug-09 5:07
0x3c014-Aug-09 5:07 
AnswerRe: string versus String ! Pin
Saksida Bojan14-Aug-09 5:09
Saksida Bojan14-Aug-09 5:09 
GeneralRe: string versus String ! Pin
humayunlalzad14-Aug-09 5:24
humayunlalzad14-Aug-09 5:24 
GeneralRe: string versus String ! Pin
Saksida Bojan14-Aug-09 8:14
Saksida Bojan14-Aug-09 8:14 

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.