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

C#

 
QuestionNull values from sql server database are displayed #VALUE! in Excel Pin
Gtari Abir13-Apr-18 6:09
Gtari Abir13-Apr-18 6:09 
AnswerRe: Null values from sql server database are displayed #VALUE! in Excel Pin
OriginalGriff13-Apr-18 6:31
mveOriginalGriff13-Apr-18 6:31 
AnswerRe: Null values from sql server database are displayed #VALUE! in Excel Pin
mecoder8915-Apr-18 22:01
mecoder8915-Apr-18 22:01 
AnswerRe: Null values from sql server database are displayed #VALUE! in Excel Pin
Gtari Abir16-Apr-18 0:27
Gtari Abir16-Apr-18 0:27 
QuestionNeed help with Functions, ASAP! Pin
Member 1377783813-Apr-18 1:30
Member 1377783813-Apr-18 1:30 
AnswerRe: Need help with Functions, ASAP! Pin
Keviniano Gayo13-Apr-18 2:01
Keviniano Gayo13-Apr-18 2:01 
AnswerRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 4:14
mve#realJSOP13-Apr-18 4:14 
AnswerRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 6:23
mve#realJSOP13-Apr-18 6:23 
Or this, which has the added benefit of handling a mix of numeric data types, and will throw an exception if you try to pass something that can't be converted to a numeric type:
C#
private static double MeanAvg(params object[] values) 
{
    return Convert.ToDouble(values.Select(Convert.ToDecimal).Average());
}

These will work:
double answer = MeanAvg(1M,3,3d);
answer = MeanAvg(1M,3M,"3");

But this will throw an exception:
C#
double answer = MeanAvg(1M,3M,"abc");

".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

AnswerRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 6:45
professionalEddy Vluggen13-Apr-18 6:45 
AnswerRe: Need help with Functions, ASAP! Pin
Gerry Schmitz13-Apr-18 7:15
mveGerry Schmitz13-Apr-18 7:15 
AnswerRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 7:49
mve#realJSOP13-Apr-18 7:49 
AnswerRe: Need help with Functions, ASAP! Pin
BillWoodruff13-Apr-18 7:51
professionalBillWoodruff13-Apr-18 7:51 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 7:53
mve#realJSOP13-Apr-18 7:53 
GeneralRe: Need help with Functions, ASAP! Pin
BillWoodruff13-Apr-18 9:12
professionalBillWoodruff13-Apr-18 9:12 
GeneralRe: Need help with Functions, ASAP! Pin
Gerry Schmitz16-Apr-18 8:17
mveGerry Schmitz16-Apr-18 8:17 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 8:26
mve#realJSOP13-Apr-18 8:26 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 8:31
mve#realJSOP13-Apr-18 8:31 
GeneralRe: Need help with Functions, ASAP! Pin
BillWoodruff13-Apr-18 9:14
professionalBillWoodruff13-Apr-18 9:14 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 8:42
mve#realJSOP13-Apr-18 8:42 
GeneralRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 9:01
professionalEddy Vluggen13-Apr-18 9:01 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:07
mve#realJSOP13-Apr-18 9:07 
GeneralRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 9:12
professionalEddy Vluggen13-Apr-18 9:12 
GeneralRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:28
mve#realJSOP13-Apr-18 9:28 
AnswerRe: Need help with Functions, ASAP! Pin
#realJSOP13-Apr-18 9:10
mve#realJSOP13-Apr-18 9:10 
PraiseRe: Need help with Functions, ASAP! Pin
Eddy Vluggen13-Apr-18 9:15
professionalEddy Vluggen13-Apr-18 9:15 

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.