locked
How can I change the language format in DataTable? RRS feed

  • Question

  • I create a DataTable to contain double value.
    In my database this value is stored with French language.
    For example : 17.5 <=> 17,5 in English.

    DataTable dt = new DataTable();           
    dt.Columns.Add("Total", typeof(double));
    DataRow dr = dt.NewRow();
    dr["Total"] =  17.5;
    dt.Rows.Add(dr);

    After that this value is changed 17,5 automatically in GridView.
    I want to keep the original value but I do not know how to do that.

    Please give the suggestion for this problem !

    Thanks in advance!
    Tuesday, March 20, 2007 10:12 AM

Answers

  • When working with Datasets and DataTables then Locale is a property that should be set always. You can set it to CurrentCulture, because it will help you to not wory about number formats and datetime formats when showing data, and also when you execute table select commands.
    Wednesday, March 21, 2007 9:27 AM

All replies

  • Hi,

    What kind of application you refer to winform or asp.net?

    Anyway, please check the format setting of the grid.

    Thanks

    Wednesday, March 21, 2007 4:53 AM
  • When working with Datasets and DataTables then Locale is a property that should be set always. You can set it to CurrentCulture, because it will help you to not wory about number formats and datetime formats when showing data, and also when you execute table select commands.
    Wednesday, March 21, 2007 9:27 AM