C# to Access Base de Dados [expert] - Versão de Impressão +- Forum Pplware (http://forum.pplware.com) +-- Fórum: Mais Tech (/forumdisplay.php?fid=11) +--- Fórum: Programação e Web (/forumdisplay.php?fid=16) +--- Tópico: C# to Access Base de Dados [expert] (/showthread.php?tid=11339) |
C# to Access Base de Dados [expert] - Charters - 13-04-2012 15:16 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) 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#). RE: C# to Access Base de Dados [expert] - Devexz - 23-04-2012 22:33 que tipo de dado escolheste quando criaste o campo? RE: C# to Access Base de Dados [expert] - Charters - 24-04-2012 16:18 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 (: |