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

C#

 
AnswerRe: Importing a csv file into sql Pin
Colin Angus Mackay25-Oct-05 1:25
Colin Angus Mackay25-Oct-05 1:25 
QuestionScrollposition in a richtextbox Pin
edvo25-Oct-05 0:34
edvo25-Oct-05 0:34 
QuestionMock object frameworks for .net 2.0 Pin
seahawk4225-Oct-05 0:03
seahawk4225-Oct-05 0:03 
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 
Surely if you are unsure of stuff like this, the best thing to do is create a simple console application and try it out?

decimal decEuro = Convert.ToDecimal(txtEuro.Text.Trim());

If the textbox is empty, you'll be trying to convert an empty string to a decimal, and an exception will be thrown so it'll never get as far as assigning decEuro.

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

The return type is Object which is the base type for everything. This object will either be a boxed value type of System.Decimal or reference type System.DBNull. You can use the .GetType() method to determine which.

Rob Philpott.
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 
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 

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.