Click here to Skip to main content

C#

    RSS: RSS Feed
Home > Forums > C#

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
GeneralRe: better way to make function returns PinmembernetJP12L7:28 20 Nov '09  
GeneralRe: better way to make function returns [modified] PinmemberSaksida Bojan7:34 20 Nov '09  
GeneralRe: better way to make function returns PinmembernetJP12L7:50 20 Nov '09  
GeneralRe: better way to make function returns PinmemberSaksida Bojan7:59 20 Nov '09  
AnswerRe: better way to make function returns Pinmember0x3c07:38 20 Nov '09  
AnswerRe: better way to make function returns Pinmembermusefan8:39 20 Nov '09  
GeneralRe: better way to make function returns PinmembernetJP12L9:34 20 Nov '09  
I got an another idea that i am sure you would have thought about it. How about if i were to return an object from every function. This way if the aspx page needs to show what were the exception they can easily show the acutal exception or a custom message. What do you guys think of this idea.
 

public Object AddUser(string username)
{
   CustomObject obj = null;
 
   try
   {
     obj = CustomObject(false,"",,"")
   }
   catch(Exception ex)
   {
      obj = CustomObject(true,"101",ex,"Database couldn't be started.")
 
   }
 
   return obj;
}
 

public class CustomObject
{
  public CustomObject(bool errorFound, string ErrorID, Exception exception, string CustomErrorMessage)
  {
  }
}

AnswerRe: better way to make function returns Pinmemberdojohansen11:59 23 Nov '09  
QuestionStream closes while reading a socket Pinmemberjoana.simoes6:11 20 Nov '09  
AnswerRe: Stream closes while reading a socket PinmemberPaulo Zemek6:57 20 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes7:19 20 Nov '09  
GeneralRe: Stream closes while reading a socket PinmemberPaulo Zemek8:44 22 Nov '09  
AnswerRe: Stream closes while reading a socket PinmvpLuc Pattyn7:27 20 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes1:13 23 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes1:39 23 Nov '09  
GeneralRe: Stream closes while reading a socket PinmvpLuc Pattyn1:43 23 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes4:56 23 Nov '09  
NewsRe: Stream closes while reading a socket Pinmemberjoana.simoes7:43 23 Nov '09  
AnswerRe: Stream closes while reading a socket Pinmemberdojohansen12:15 23 Nov '09  
NewsRe: Stream closes while reading a socket Pinmemberjoana.simoes2:37 24 Nov '09  
QuestionExcel Formatting. PinmemberFEMDEV5:47 20 Nov '09  
AnswerRe: Excel Formatting. Pinmembertoby319:16 20 Nov '09  
GeneralRe: Excel Formatting. PinmemberFEMDEV23:44 22 Nov '09  
QuestionSQLite Pinmemberjashimu4:26 20 Nov '09  
AnswerRe: SQLite PinmemberMeLight4:35 20 Nov '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.5.120210.1 | Last Updated 13 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid