Forum Pplware

Versão Completa: C# to Access Base de Dados [expert]
Está de momento a ver uma versão reduzida do nosso conteúdo. Ver versão completa com o formato adequado.
Hello, i am doing an application (in C# Windows Forms) which consists of basically database connect in between C# and Microsoft Access 2010. To show the Database from MS Access i have a datagridview.
The connection between them was created with the help of C# tool itself (databinding or something). It has 5 collumns and only two of the have numeric format. One of them is double, altho, when i'm saving (from the datagridview) let's say, 1172,44 into Microsoft Access and then, re-open the application, the number i get is 117244 (which misses the comma). I don't know what's causing this, i have tried switching to decimal, single and of course double. Tryed using the System.CultureInfo way to go around but it just seems like it won't fix anything. Also tried to parse the number on the fly but couldn't do it. The last thread i did was closed because Apparently it was vague..
Saving a double value to Access Database From C# There it is so you can see what i've progressed since i started playing around with all the settings and configurations. I don't really know what else to do and i just really think updating an Access database with a double should be an easy task but it's not as it seems.

Code Used to Update Access Database from Datagridview:

Código:
private void button1_Click(object sender, EventArgs e)
{
    try {
        this.Validate();
        this.tabelaTesteBindingSource.EndEdit();
        this.tabelaTesteTableAdapter.Update(database1DataSet);
        MessageBox.Show("Guardado com sucesso!!");
    } catch (System.Exception ex) {
        MessageBox.Show("A gravação falhou!!");
    }
}
after this i close the apllication, load it again and the number 1172,44 is gone and it shows as 117244!

Eu tenho isto em vários forums estrangeiros, já fiz de tudo e começo a desconfiar que o problema não está no C# mas sim na base de dados Access . As colunas estão formatadas para guardarem números double . Logo deveria dar para utilizar a vírgula. No entanto ao fazer loading à base de dados para uma datagridview a vírgula desaparece como disse em cima várias vezes. Já experimentei mudar as definições regionais e não é disso pelo menos não do Visual Studio (C#).
que tipo de dado escolheste quando criaste o campo?
Já arranjei obrigado . Os dados eram double double mas não sei porquê não funcionava . Eu pus texto no access e double no c# e acabou por funcionar (:
URL's de Referência