473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

casting from sql server money

M K
What do I cast from in C# to money in Sql Server? float?
Jun 28 '07 #1
4 3376
M K
same question for date in C#
"M K" <sk********************@yahoo.comwrote in message
news:%h****************@newsread2.news.pas.earthli nk.net...
What do I cast from in C# to money in Sql Server? float?

Jun 28 '07 #2
On Jun 28, 3:08 pm, "M K" <ski_freakREMOVETHEC...@yahoo.comwrote:
same question for date in C#

"M K" <ski_freakREMOVETHEC...@yahoo.comwrote in message

news:%h****************@newsread2.news.pas.earthli nk.net...
What do I cast from in C# to money in Sql Server? float?
I think decimal would be better for monetary types. As for date, just
use date.

Chris

Jun 28 '07 #3
M K
This does not work...

cmd.Parameters.Add("@BasePay", SqlDbType.Money).Value =
Convert.ToDecimal(txtPay.Text);
what am i doing wrong?

"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
On Jun 28, 3:08 pm, "M K" <ski_freakREMOVETHEC...@yahoo.comwrote:
>same question for date in C#

"M K" <ski_freakREMOVETHEC...@yahoo.comwrote in message

news:%h****************@newsread2.news.pas.earthl ink.net...
What do I cast from in C# to money in Sql Server? float?

I think decimal would be better for monetary types. As for date, just
use date.

Chris

Jul 1 '07 #4
M K
guess it doesnt convert to a number with a $ in it.. :)

now it does w/o the $ .. funny how that is.. uggg.. guess its tooooo early

"M K" <sk********************@yahoo.comwrote in message
news:LR*****************@newsread3.news.pas.earthl ink.net...
This does not work...

cmd.Parameters.Add("@BasePay", SqlDbType.Money).Value =
Convert.ToDecimal(txtPay.Text);
what am i doing wrong?

"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
>On Jun 28, 3:08 pm, "M K" <ski_freakREMOVETHEC...@yahoo.comwrote:
>>same question for date in C#

"M K" <ski_freakREMOVETHEC...@yahoo.comwrote in message

news:%h****************@newsread2.news.pas.earth link.net...

What do I cast from in C# to money in Sql Server? float?

I think decimal would be better for monetary types. As for date, just
use date.

Chris


Jul 1 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing the code. Thank you. .. Facundo
6
by: Chris Kennedy | last post by:
I am pulling a decimal value from SQL server and trying to use the format currency and format number function. I am using these values in a large string of HTML to be used in a CDONTS Email. If I...
2
by: ajjvn | last post by:
I 'inherited' a group of SQL Server server class machines. They are true server technology but the disk sub-systems are lacking. There is one hot-swap backplane that all the drives share (with...
27
by: Oracle Newbie | last post by:
I got a new Job where I have to handle Oracle databases on Linux. My previous experience is with Sql Server on Windows NT. I want to know how difficult will this shift be and what do I need to...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
7
by: S. Lorétan | last post by:
Hi guys, Sorry for this stupid question, but I don't know why it isn't working. Here is my (example) code: namespace Test { class A { public string Label1; }
4
by: Hrsoft | last post by:
Dear Friends My developer environmment has a Windows 2000 SP4 Server, and I can´t to update to 2003 or 2008, for reasons of... money. But, I need to install in this 2000 Server SP4 the...
15
by: ingejg | last post by:
I am starting to study internet synchronization, and my head is still spinning since internet is not my forte, however my boss is breathing down my neck at the moment. Our company has only one...
1
by: pexp | last post by:
Hello All, I would like to insert/update a database table using excel file. I have a list of products in an excel file. If product exist in a database table tblproduct than it should update the...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.