Hello all!
I tried a few things, can't seem to figure out the right combination. here
the snippet of CODE
Dim cmdBet As SqlCommand
Dim ConWg As New SqlConnection
Try
ConWg = New
SqlConnection("Server=Localhost;uid=xx;pwd=xxxx;da tabase=xxx")
cmdBet = New SqlCommand("PlBetII", ConWg)
cmdBet.CommandType = CommandType.StoredProcedure
'cmdBet.Parameters.Add("@Credits", SqlDbType.NVarChar).Value =
txbCredits.Text
cmdBet.Parameters.Add("@Wager", SqlDbType.Decimal).Value =
txbTotWage.Text
cmdBet.Parameters.Add("@UserID", SqlDbType.VarChar).Value =
txbTableIDm.Text
ConWg.Open()
cmdBet.ExecuteNonQuery()
ConWg.Close()
Catch ex As Exception
Label4.Text = ex.Message.ToString
End Try
The value in txbTotWage is like this "$6.00"
My SP PlBetII is good, and @wage is deciaml. I get this on Exception. "Input
string was not in correct format" I know that if I take the "$" away, it
should be fine, so how do I go about fixing this. SQL should take I thought.
When Itried to use Money in the SQL table, in my vb.net app, it says it's not
correct format. Any ideas?
TIA!!!
Rudy 1 1067
Money is just a 64 bit fixed point number with four decimal places. It
carries no information on the currency used, so you have to strip away
the currency from the value.
Rudy wrote: Hello all!
I tried a few things, can't seem to figure out the right combination. here the snippet of CODE Dim cmdBet As SqlCommand Dim ConWg As New SqlConnection Try ConWg = New SqlConnection("Server=Localhost;uid=xx;pwd=xxxx;da tabase=xxx") cmdBet = New SqlCommand("PlBetII", ConWg) cmdBet.CommandType = CommandType.StoredProcedure 'cmdBet.Parameters.Add("@Credits", SqlDbType.NVarChar).Value = txbCredits.Text cmdBet.Parameters.Add("@Wager", SqlDbType.Decimal).Value = txbTotWage.Text cmdBet.Parameters.Add("@UserID", SqlDbType.VarChar).Value = txbTableIDm.Text ConWg.Open() cmdBet.ExecuteNonQuery() ConWg.Close() Catch ex As Exception Label4.Text = ex.Message.ToString End Try The value in txbTotWage is like this "$6.00" My SP PlBetII is good, and @wage is deciaml. I get this on Exception. "Input string was not in correct format" I know that if I take the "$" away, it should be fine, so how do I go about fixing this. SQL should take I thought. When Itried to use Money in the SQL table, in my vb.net app, it says it's not correct format. Any ideas?
TIA!!!
Rudy
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Newsgroup - Ann |
last post by:
Hi, I got a question a tricky type conversion:
double * ==> const double * and
double ** ==> const double * const * are both permitted, while
double ** ==> const double ** is NOT permitted.
...
|
by: Proteus |
last post by:
Any help appreciated on a small perl project I need to write for
educator/teaching purposes. I have not programmed perl for some time, need
to get up to speed, maybe some kind souls hrere will help...
|
by: GRoll21 |
last post by:
In this program, it is going to change a value in the array. So to give
it it's new value I need to assign it the new value. It doesn't like
the conversion. Here is the error.
...
|
by: Bjørn Augestad |
last post by:
Below is a program which converts a double to an integer in two
different ways, giving me two different values for the int. The basic
expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
|
by: Rich |
last post by:
(1) Is there a better place to pose the question below?
(2) I am starting to convert my enterprise solution from VS 2003 (.NET
v1.1.4322) to VS 2005 Professional (.NET v2.0.50727).
The entire...
|
by: dba_222 |
last post by:
Dear Experts,
Ok, I hate to ask such a seemingly dumb question, but I've
already spent far too much time on this. More that I
would care to admit.
In Sql server, how do I simply change a...
|
by: Alberto Salvati |
last post by:
Hi, List.
My company has a VERY BIG product base on db2 udb v7.x.
We want to di an upgrade to v9, but.... current db has a lot of
procedure (cobol..!).
Therefore, we've planned to rewrite this...
|
by: Tony Johansson |
last post by:
Hello!
Why does not this cause a compile error because a ulong has never been
implicitly convertible to byte?
ulong vektor = {100000,200000,300000};
foreach(byte b in vektor)
{...
|
by: alex.j.k2 |
last post by:
Hello all,
I have "PRECISION" defined in the preprocessor code
and it could be int, float or double, but I do not know in the
code what it is.
Now if I want to assign zero to a "PRECISION"...
|
by: Chris M. Thomasson |
last post by:
I use the following technique in all of my C++ projects; here is the example
code with error checking omitted for brevity:
_________________________________________________________________
/*...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |