简体   繁体   English

我如何从C#中的数据集获取精度和小数位数?

[英]How do I get precision and scale from a DataSet in c#?

I have data sets with schema defined from xml schemas. 我有从xml架构定义的架构的数据集。 Scale and Precision are in the XML schemas, but I don't seem to be able to pull them from the columns of the data tables in the data set. Scale和Precision在XML模式中,但是我似乎无法从数据集中数据表的列中提取它们。 I'm writing the data out to ESRI shape files and need the scale and precision to define the types for the columns. 我正在将数据写到ESRI形状文件中,并且需要比例和精度来定义列的类型。 I saw a method for getting scale and precision from the data, but my data doesn't necessarily have values in the max range of scale and precision from the xml files. 我看到了一种从数据中获取比例和精度的方法,但是我的数据不一定具有xml文件中比例和精度的最大范围内的值。

So is there a way to pull precision and scale from the DataSet? 那么有没有办法从数据集中提取精度和规模?

Thanks for you help. 感谢您的帮助。

DataSet.Tables["TableName"].Columns["ColumnName"].ExtendedPreoprties["PropertyName"].ToString(). DataSet.Tables [ “表名”]。列[ “的ColumnName”]。ExtendedPreoprties [ “属性名”]。的ToString()。

If you're saying that the xml file doesn't have the scale and precision defined, well, then, you're hosed. 如果您说的是xml文件没有定义比例和精度,那么您就被束之高阁。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM