Click here to Skip to main content
15,891,567 members
Home / Discussions / C#
   

C#

 
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 
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 
ma se wrote:
If I have the following, what is the value of decEuro if the textbox txtEuro is empty? decimal decEuro = Convert.ToDecimal(txtEuro.Text.Trim());


The Visual Studio help file tells you (use MSDN if you don't have Visual Studio) that you will throw an ArgumentException if the value is null, FormatException if "value does not consist of an optional sign followed by a sequence of digits (zero through nine) and an optional decimal point symbol.'


ma se wrote:
Is decimal the best data type used for a currency value?


I don't work with currencies, I can't help you there.


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

The datatype/type returned when decCheckDecimal contains a value, is decimal, or Object?

When it contains a value, it will be a decimal. You will need to caste it as such. The proper technique is:

decimal value = (decimal)CheckDecimalFOrDB( d ) as decimal;
if ( value != null ) {
   ....
}

Again the help file has this documented. Look up 'as operator'.

Can't help you with the Euro Formatting

My suspicion is that you should use the Response.Redirect. The Server.Transfer is performed strictly on the server side, the browser is unaware that it has been directed to a new page. If the user does a refresh, they will be redirected back to the original page.

Response.Redirect causes the browser to request the new page. Values will need to be passed by other means such as a cookie or session state. If session state is used and memory is an issue, be sure to recover the session memory by setting the values to null after you have extracted them.

See the Visual studio help file at ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dv_vbcode/html/vbtskCodeExamplePassingDataFromOneWebPageToAnother.htm






Brian Leach
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 
AnswerRe: Class Stucture Question Pin
Christian Graus24-Oct-05 15:26
protectorChristian Graus24-Oct-05 15:26 
GeneralRe: Class Stucture Question Pin
jgallen2324-Oct-05 15:35
jgallen2324-Oct-05 15:35 
GeneralRe: Class Stucture Question Pin
Christian Graus24-Oct-05 15:39
protectorChristian Graus24-Oct-05 15:39 
GeneralRe: Class Stucture Question Pin
jgallen2324-Oct-05 16:46
jgallen2324-Oct-05 16:46 

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.