Solved

The dataset is created with a DOUBLE datatype instead of a DECIMAL datatype for the numeric column.

Posted on 2013-11-12
2
298 Views
Last Modified: 2013-11-12
da.FillSchema(ds,SchemaType.Source);
            ds.WriteXmlSchema(AppDomain.CurrentDomain.BaseDirectory + @"\ds_1.txt");

Returns this...

<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Table">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="A" type="xs:double" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

I understand I need to change it from xs:double to Decimal type before filling the dataset in order to get accurate data.

Can someone tell me how to do that?
0
Comment
Question by:gswitz
2 Comments
 
LVL 10

Accepted Solution

by:
joriszwaenepoel earned 500 total points
ID: 39641868
You need to write some code like this:

ds.Tables(0).Columns("A").DataType = GetType(Decimal)
0
 

Author Closing Comment

by:gswitz
ID: 39641883
Haha! You JUST beat me. I was coming to post the same and you already had!! Thanks for your help!!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET Textbox input validation 4 61
How to share My.Settings in multiple application instances ? 7 48
Need syntax help building hyperlink 2 38
IDE for Python 5 62
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question