Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
SQL Server 2000/2005/2008, Express, Access, MySQL, Oracle
UPDATE formato numerico su foglio excel
sabato 05 marzo 2011 - 09.21
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
Elenco Tags
C#
|
.NET 3.5
|
Windows Server 2003
|
Windows XP
|
Visual Studio Express
|
SQL Server 2005
|
SQL Server Express
|
MySQL 5.0
|
Access (.mdb)
|
Office 2007
|
Office 2003
|
Internet Explorer 7.0
|
Javascript
|
XHTML 2.0
secks
Profilo
| Senior Member
442
messaggi | Data Invio:
sab 5 mar 2011 - 09:21
Buongiorno.
In ambiente C# express 3.5 ho connesso un foglio excel con la seguente stringa
cn = new System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + txtFil.Text + "';Extended Properties=Excel 8.0;");
scrivo nel foglio determinati campi come da seguente comando e tutto ok.
s = "UPDATE [cat_mp_003_master_ET$] SET ";
s += "SPACART = '" + Convert.ToString(j[0]["CODPRO"]) + "', ";
s += "SPACCNE = " + Convert.ToString(j[0]["COS3"]).Replace(",", ".") + ", ";
s += "SPACL14 = " + Convert.ToString(j[0]["PRZ14"]).Replace(",", ".") + ", ";
s += "SPACL03 = " + Convert.ToString(j[0]["PRZ03"]).Replace(",", ".") + " ";
s += "WHERE EAN='" + Convert.ToString(y["EAN"]) + "'";
Il problema è che nelle celle con formato numerico viene scritto il valore con un'apice davanti, trasformandolo in stringa.
Come posso fare in modo che con l'UPDATE dei campi numerici non vengano trasformati in stringa nel foglio excel ma mantenuti come valori numerici?
Saluti e grazie.
Paolo.
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !