Al final lo recibi pasando el excel a XML y listo! ejjej Gracias igual! :) 2010/7/6 Diego Spinedi <[email protected]>
> Yo tuve algo parecido y termine tratandolo como objecto Excel, y hasta > arme una “clasesita” de Excel dentro de mi proyecto que ya me deja hacer de > todo… > > Si te interesa te paso una rutina de lectura que tengo que hasta ahora no > ha fallado… > > Interpreto muy básicamente, que algo “choca” entre OLEDB y Excel. > > Saludos > > > > Diego > ------------------------------ > > *De:* [email protected] [mailto:[email protected]] *En nombre de *Leandro > Halfon > *Enviado el:* lunes, 05 de julio de 2010 8:57 > > *Para:* [email protected] > *Asunto:* [puntonet] Problema al leer excel > > > > el codigo es este: > > string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data > Source=" + txtFile.Text.Trim() + ";" + "Extended Properties=Excel 8.0;"; > DbProviderFactory factory = > DbProviderFactories.GetFactory("System.Data.OleDb"); > > using (DbConnection connection = factory.CreateConnection()) > { > connection.ConnectionString = connectionString; > > using (DbCommand command = connection.CreateCommand()) > { > command.CommandText = "SELECT * FROM [Sheet1$]"; > connection.Open(); > > using (DbDataReader dr = command.ExecuteReader()) > { > while (dr.Read()) > { > if (!String.IsNullOrEmpty(dr[0].ToString())) > { > string idUsuario = dr[0].ToString(); > string tipoPack = dr[1].ToString(); > string marca = dr[2].ToString(); > string modelo = dr[3].ToString(); > string subtitulo = dr[4].ToString(); > ......... > > } > > } > > } > > } > > } > > > No creo tener nada raro... > > 2010/7/3 Leonardo Micheloni <[email protected]> > > tenés el ejemplo del código? > > > 2010/7/2 Leandro Halfon <[email protected]>: > > Lista...estoy leyendo con OLEDB un archivo excel, y por alguna razon en > > algunos campos no me lee todos el texto completo. > > Probe de pasar todas las celdas a formato texto y el proble sigue... > > > > > > alguna sugerencia? > > > > > > Gracias! > > > > >
