Click here to Skip to main content
15,894,291 members
Home / Discussions / C#
   

C#

 
QuestionUploading and resizing Image files Pin
Brendan Vogt24-Oct-05 23:43
Brendan Vogt24-Oct-05 23:43 
AnswerRe: Uploading and resizing Image files Pin
KaptinKrunch25-Oct-05 2:46
KaptinKrunch25-Oct-05 2:46 
QuestionUpdater Application Block for Office Add In Pin
JeremyHutchinson24-Oct-05 23:19
JeremyHutchinson24-Oct-05 23:19 
Questiona couple of C# questions Pin
Brendan Vogt24-Oct-05 23:05
Brendan Vogt24-Oct-05 23:05 
AnswerRe: a couple of C# questions Pin
Rob Philpott24-Oct-05 23:52
Rob Philpott24-Oct-05 23:52 
QuestionRe: a couple of C# questions Pin
Brendan Vogt25-Oct-05 1:06
Brendan Vogt25-Oct-05 1:06 
AnswerRe: a couple of C# questions Pin
Rob Philpott25-Oct-05 1:33
Rob Philpott25-Oct-05 1:33 
QuestionRe: a couple of C# questions Pin
Brendan Vogt25-Oct-05 1:50
Brendan Vogt25-Oct-05 1:50 
Hi again yes,

This how I create my parameter:

SqlParameter paramPound = new SqlParameter("@Pound", SqlDbType.Money, 8);
paramPound.Value = Globals.CheckDecimalForDB(objProperty.Pound);
objCmd.Parameters.Add(paramPound);


I just have 2 questions:

Firstly, because the SQL Server table field is of type money, can I use a decimal? And secondly, with regards to your cast to decimal, it will throw an exception. So the best way to do this is to leave the cast out?

For if you must know, this is my check function:

public static Object CheckDecimalForDB(decimal decCheckDecimal)
{
if(decCheckDecimal != 0)
return decCheckDecimal;
else
return DBNull.Value;
}

How would you do it? Would you just do a test for this when you create your parameters?

Cheers.
AnswerRe: a couple of C# questions Pin
Rob Philpott25-Oct-05 2:05
Rob Philpott25-Oct-05 2:05 
AnswerRe: a couple of C# questions Pin
Gavin Jeffrey25-Oct-05 0:00
Gavin Jeffrey25-Oct-05 0:00 
QuestionRe: a couple of C# questions Pin
Brendan Vogt25-Oct-05 1:12
Brendan Vogt25-Oct-05 1:12 
AnswerRe: a couple of C# questions Pin
Brian Leach25-Oct-05 10:39
Brian Leach25-Oct-05 10:39 
QuestionPlease help me... Pin
KORCARI24-Oct-05 21:39
KORCARI24-Oct-05 21:39 
AnswerRe: Please help me... Pin
Peto198325-Oct-05 2:11
Peto198325-Oct-05 2:11 
QuestionC# Reflection Pin
koyllis24-Oct-05 21:06
koyllis24-Oct-05 21:06 
AnswerRe: C# Reflection Pin
Rob Philpott25-Oct-05 0:05
Rob Philpott25-Oct-05 0:05 
QuestionOther sources with C# Pin
Anonymous24-Oct-05 19:29
Anonymous24-Oct-05 19:29 
AnswerRe: Other sources with C# Pin
Christian Graus24-Oct-05 19:33
protectorChristian Graus24-Oct-05 19:33 
QuestionCreating toolbox in C# Pin
nps_ltv24-Oct-05 19:05
nps_ltv24-Oct-05 19:05 
AnswerRe: Creating toolbox in C# Pin
Christian Graus24-Oct-05 19:13
protectorChristian Graus24-Oct-05 19:13 
AnswerRe: Creating toolbox in C# Pin
edvo25-Oct-05 0:42
edvo25-Oct-05 0:42 
QuestionData posting Pin
NET_GEEK24-Oct-05 18:21
NET_GEEK24-Oct-05 18:21 
QuestionServer.Create(<Object>) Pin
NET_GEEK24-Oct-05 18:16
NET_GEEK24-Oct-05 18:16 
AnswerRe: Server.Create(<Object>) Pin
Christian Graus24-Oct-05 18:51
protectorChristian Graus24-Oct-05 18:51 
QuestionClass Stucture Question Pin
jgallen2324-Oct-05 14:49
jgallen2324-Oct-05 14:49 

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.