Click here to Skip to main content
15,890,438 members
Home / Discussions / Database
   

Database

 
General[Message Deleted] Pin
Niladri_Biswas1-Jul-09 22:19
Niladri_Biswas1-Jul-09 22:19 
GeneralRe: Help necessary in making Query Pin
Mycroft Holmes1-Jul-09 22:48
professionalMycroft Holmes1-Jul-09 22:48 
AnswerRe: Help necessary in making Query Pin
Niladri_Biswas1-Jul-09 20:39
Niladri_Biswas1-Jul-09 20:39 
QuestionTrigger NOT Fireing... Pin
Elizma1-Jul-09 9:36
Elizma1-Jul-09 9:36 
AnswerRe: Trigger NOT Fireing... Pin
Blue_Boy1-Jul-09 11:22
Blue_Boy1-Jul-09 11:22 
AnswerRe: Trigger NOT Fireing... Pin
Jerry Hammond1-Jul-09 12:28
Jerry Hammond1-Jul-09 12:28 
GeneralRe: Trigger NOT Fireing... [modified] Pin
Elizma1-Jul-09 20:48
Elizma1-Jul-09 20:48 
QuestionDecimal field format problem Pin
Branislav Vidovic1-Jul-09 3:25
Branislav Vidovic1-Jul-09 3:25 
Hy!
I have problem enetring data from my application to the database datable. Basicly this is the table in MS Access 2003 desgin:
table name: details
table fields:
acountNum (Text, primary key)
itemId (Integer, primary key)
price(Decimal, format: 0,000)
quantity(Long integer)

The problem is when i use my insert method which has a line that goes like this:
komanda.CommandText = "INSERT INTO details(acountNum, itemId, price, quantity) VALUES ('" + par1 + "', " + par2 + ", " + par3 + ", " + par4 + ")";

I use step by stet debuging in studio and check that all the values are correct. But what happens is a problem on a third field of the table. It is formated to represent data in 0,000. That means if you enetr just 3 it wil show like 3,000 in the database. Or if you enetr 2,98 it will show as 2,980 etc..
So let us say that in above comand i pased in these values for variables that store values:
par1 = "98bg", par2 = 12, par3 = 4.7 and part4 = 10. When you execute this command in step by step debuger and check the CommandText property it will look like this:
komanda.CommandText = "INSERT INTO details(acountNum, itemId, price, quantity) VALUES ('98bg', 12, 4,700, 10)";

We see that the command (which has its connection field already set to a opened connection prior to this) immediatly applied the format rule of price field and turned 4.7 into 4,700. Now of course when i execute the DataAdapter.Update method it will thorow an exception because now we have only 4 fields to insert values and actually 5 values ('98bg', 12, 4,700, 10). 4.7 became 4,700. Of course if i remove the format for the price field in my databse the command works perfectly. But in this situation i ned to have this format of numbers for the price.
Does anyone have an idea how to over come this small problem?

Cheers!
AnswerRe: Decimal field format problem Pin
Enver Maroshi1-Jul-09 6:58
Enver Maroshi1-Jul-09 6:58 
GeneralRe: Decimal field format problem Pin
Branislav Vidovic1-Jul-09 12:19
Branislav Vidovic1-Jul-09 12:19 
GeneralRe: Decimal field format problem Pin
Enver Maroshi1-Jul-09 23:18
Enver Maroshi1-Jul-09 23:18 
GeneralRe: Decimal field format problem Pin
Blue_Boy2-Jul-09 3:03
Blue_Boy2-Jul-09 3:03 
QuestionMDB opened indication Pin
udikantz1-Jul-09 0:05
udikantz1-Jul-09 0:05 
AnswerRe: MDB opened indication Pin
paas1-Jul-09 1:46
paas1-Jul-09 1:46 
AnswerRe: MDB opened indication Pin
Branislav Vidovic1-Jul-09 3:54
Branislav Vidovic1-Jul-09 3:54 
GeneralRe: MDB opened indication Pin
udikantz1-Jul-09 4:45
udikantz1-Jul-09 4:45 
GeneralRe: MDB opened indication Pin
David Skelly1-Jul-09 6:17
David Skelly1-Jul-09 6:17 
GeneralRe: MDB opened indication Pin
riced2-Jul-09 7:09
riced2-Jul-09 7:09 
QuestionSplitting Rows in SQL Server 2005 Pin
rajanandal30-Jun-09 19:04
rajanandal30-Jun-09 19:04 
AnswerRe: Splitting Rows in SQL Server 2005 [modified] Pin
Niladri_Biswas30-Jun-09 20:02
Niladri_Biswas30-Jun-09 20:02 
GeneralRe: Splitting Rows in SQL Server 2005 Pin
rajanandal30-Jun-09 20:32
rajanandal30-Jun-09 20:32 
GeneralRe: Splitting Rows in SQL Server 2005 [modified] Pin
Niladri_Biswas30-Jun-09 20:45
Niladri_Biswas30-Jun-09 20:45 
AnswerRe: Splitting Rows in SQL Server 2005 [modified] Pin
rajanandal30-Jun-09 20:53
rajanandal30-Jun-09 20:53 
GeneralGreen Screen Studio Pin
atlas2130-Jun-09 17:07
atlas2130-Jun-09 17:07 
GeneralRe: Green Screen Studio Pin
Mycroft Holmes30-Jun-09 17:49
professionalMycroft Holmes30-Jun-09 17: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.