Click here to Skip to main content
16,005,178 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Question[Message Deleted] Pin
nishkarsh_k6-May-08 3:30
nishkarsh_k6-May-08 3:30 
AnswerRe: Error while saving image to file "A generic error occurred in GDI+." Pin
Dave Kreskowiak6-May-08 3:48
mveDave Kreskowiak6-May-08 3:48 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
nishkarsh_k6-May-08 4:02
nishkarsh_k6-May-08 4:02 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
Dave Kreskowiak6-May-08 4:33
mveDave Kreskowiak6-May-08 4:33 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
nishkarsh_k6-May-08 9:36
nishkarsh_k6-May-08 9:36 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
Dave Kreskowiak6-May-08 10:03
mveDave Kreskowiak6-May-08 10:03 
GeneralRe: Error while saving image to file "A generic error occurred in GDI+." Pin
nishkarsh_k6-May-08 10:38
nishkarsh_k6-May-08 10:38 
QuestionByRef vs Return Pin
Kevin Brydon6-May-08 3:12
Kevin Brydon6-May-08 3:12 
I am currently building a simple database access class. I have a function GetCourse which I want to get a course object from the database.

I could specify it like this:

<br />
public static function GetCourse(byval courseid as integer) as Course<br />


An alternative would be:

<br />
public static function GetCourse(byval courseid as integer, byref course as Course) as Boolean<br />


the two methods are only different by how they return the values. the first would return Nothing when it couldnt find a course (throw an exception or return Nothing when a database error occurred). the second function would return false when it couldnt find a course and true when it could (either throwing exceptions or returning false in the case of a db error) and it would assign the course details to the course parameter.

The calling method would either check for Nothing in the case of the first function or check for true/false in the case of the second function to indicate that the course could be found.

I would like to hear peoples opinions on which function you would prefer and why. Or if there is a better alternative

Thanks!
AnswerRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 3:45
mveDave Kreskowiak6-May-08 3:45 
GeneralRe: ByRef vs Return Pin
Kevin Brydon6-May-08 4:43
Kevin Brydon6-May-08 4:43 
GeneralRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 4:55
mveDave Kreskowiak6-May-08 4:55 
GeneralRe: ByRef vs Return Pin
Kevin Brydon6-May-08 5:54
Kevin Brydon6-May-08 5:54 
GeneralRe: ByRef vs Return Pin
Dave Kreskowiak6-May-08 6:17
mveDave Kreskowiak6-May-08 6:17 
AnswerRe: ByRef vs Return Pin
Guffa6-May-08 6:41
Guffa6-May-08 6:41 
GeneralRe: ByRef vs Return Pin
supercat96-May-08 6:50
supercat96-May-08 6:50 
GeneralRe: ByRef vs Return Pin
Guffa6-May-08 9:35
Guffa6-May-08 9:35 
GeneralRe: ByRef vs Return Pin
Kevin Brydon7-May-08 6:26
Kevin Brydon7-May-08 6:26 
Questionsearching in listview Pin
idi6-May-08 2:45
idi6-May-08 2:45 
AnswerRe: searching in listview Pin
Dave Kreskowiak6-May-08 3:38
mveDave Kreskowiak6-May-08 3:38 
GeneralRe: searching in listview Pin
idi7-May-08 1:21
idi7-May-08 1:21 
GeneralRe: searching in listview Pin
Dave Kreskowiak7-May-08 2:01
mveDave Kreskowiak7-May-08 2:01 
Questionsend messages to cell phones Pin
Siboniso6-May-08 1:54
Siboniso6-May-08 1:54 
AnswerRe: send messages to cell phones Pin
Christian Graus6-May-08 1:56
protectorChristian Graus6-May-08 1:56 
QuestionResize / Reduce / shrink Image Size Pin
nishkarsh_k6-May-08 1:36
nishkarsh_k6-May-08 1:36 
AnswerRe: Resize / Reduce / shrink Image Size Pin
Christian Graus6-May-08 1:57
protectorChristian Graus6-May-08 1:57 

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.