lost precision when pulling decimal
-
I'm quite new to both DBMSs and Linq... I've looked numerous places for the answer, which I'm sure is quite elementary. However, I'm sure my lack of full understanding is probably why I can't find the answer either. So any help is greatly appreciated. I'm working with VS '08 express and SQL Server Express. I have a table called 'Quotes' that has a column called 'Bid' in it that is type decimal(18,8). I used the Object Relational Designer to create an entity class called 'Quote.' I am then querying the table with these two lines: DataClasses1DataContext db = new DataClasses1DataContext(); Quote q = db.Quotes.SingleOrDefault(m => m.Id == someId); The problem that I'm having is that when I go to use q.Bid, the value has been rounded to the nearest integer. This is obviously not desirable. Brandon W.
-
I'm quite new to both DBMSs and Linq... I've looked numerous places for the answer, which I'm sure is quite elementary. However, I'm sure my lack of full understanding is probably why I can't find the answer either. So any help is greatly appreciated. I'm working with VS '08 express and SQL Server Express. I have a table called 'Quotes' that has a column called 'Bid' in it that is type decimal(18,8). I used the Object Relational Designer to create an entity class called 'Quote.' I am then querying the table with these two lines: DataClasses1DataContext db = new DataClasses1DataContext(); Quote q = db.Quotes.SingleOrDefault(m => m.Id == someId); The problem that I'm having is that when I go to use q.Bid, the value has been rounded to the nearest integer. This is obviously not desirable. Brandon W.
-
I'm quite new to both DBMSs and Linq... I've looked numerous places for the answer, which I'm sure is quite elementary. However, I'm sure my lack of full understanding is probably why I can't find the answer either. So any help is greatly appreciated. I'm working with VS '08 express and SQL Server Express. I have a table called 'Quotes' that has a column called 'Bid' in it that is type decimal(18,8). I used the Object Relational Designer to create an entity class called 'Quote.' I am then querying the table with these two lines: DataClasses1DataContext db = new DataClasses1DataContext(); Quote q = db.Quotes.SingleOrDefault(m => m.Id == someId); The problem that I'm having is that when I go to use q.Bid, the value has been rounded to the nearest integer. This is obviously not desirable. Brandon W.
Sorry, but I did a quick test and can't confirm this behavior. I have decimal columns that are being returned fine. Check the datatype of the column attribute in the generated class for the Bid property.
only two letters away from being an asset
-
I'm quite new to both DBMSs and Linq... I've looked numerous places for the answer, which I'm sure is quite elementary. However, I'm sure my lack of full understanding is probably why I can't find the answer either. So any help is greatly appreciated. I'm working with VS '08 express and SQL Server Express. I have a table called 'Quotes' that has a column called 'Bid' in it that is type decimal(18,8). I used the Object Relational Designer to create an entity class called 'Quote.' I am then querying the table with these two lines: DataClasses1DataContext db = new DataClasses1DataContext(); Quote q = db.Quotes.SingleOrDefault(m => m.Id == someId); The problem that I'm having is that when I go to use q.Bid, the value has been rounded to the nearest integer. This is obviously not desirable. Brandon W.
The type is showing up as decimal in the data designer. Strangely, it now seems to be working, without any real intervention on my part. The only thing I did, was to try changing the Bid type to Numeric (still didn't work) and then back to Decimal (now working). The only thing I can figure is that somehow it was wrong in the designer, but by going through my changes I managed to get it to change to the correct type...? This is in spite of the fact that I'm fairly certain that from the start I had the type as decimal in my table. I'll be designing some more tables, so I'll try to be sure to pay very close attention to what I'm doing, in case it happens again. BW