Hi, Suppose I have exported an excel sheet then, if I add another row to the exported excel sheet and try to import the same to the database, it does not import the newly added row while the remaining rows are imported successfully. Can anyone help me? Thanks.
I also tried the same thing. But in my case, it was some other kind of error I faced. The 'Import Sheet' relies on the default worksheet name i.e. Sheet1 whereas the exported file will have some other worksheet name most of the times (generally same as the file name). So, when I edited the exported file and tried to import it back, it faced some internal error. I got no way to change or reset the worksheet name while exporting a .xls or .xlsx file.
I use the code and I just adjust it but i can found why it didn't work? this is the error it shows : "The Microsoft Jet database engine could not find the object 'dbo.Prueba'. Make sure the object exists and that you spell its name and the path name correctly." dbo.Prueba is my table and I change the security on it so I can write on it but nothing happens it keep telling the same I don't know what to do. here is my code ' Retrieve data from the Excel spreadsheet. Protected Function RetrieveData(st
rConn As String) As DataTable Dim dtExcel As New DataTable() Using conn As New OleDbConnection (strConn) ' Initialize an OleDbDataAdapte r object. Dim da As New OleDbDataAdapte r("SELECT name, phone FROM [dbo.Prueba]", conn) ' Fill the DataTable with data from the Excel spreadsheet. da.Fill(dtExcel ) End Using Return dtExcel End Function
Dim da As New OleDbDataAdapte
r("SELECT name, phone FROM [Sheet1$]", conn)
I have downloaded the CSASPNETExcelIm
portExport.zip, but I get the error when I try to unzip the file with WINZIP 11.2, could you help me? Thanks! Access http://dl.dropb ox.com/u/209352 /Error.png to see error info.
You can use win.rar to unpack.
When I've tried something similar a few years ago, getting data from Excel through OleDb was not working on x64 systems (Windows Server 2003 R2 x64). Has this changed? If it works only on 32-bit systems, please mark this sample as such. And I would suggest this for other samples also: by default - it works on both architectures, and if it works on one architecture - please, mark it as such. And please, don't forget about ARM and Windows 8: maybe some of the samples don't work on this new platform and I'd like to know about that BEFORE trying them out.
Works on my x64 environment.
string strExtension = Path.GetExtensi
on(strFileName) ; 并没有判断扩展名是大写的情况。 Response.Write( "<script>alert( 'Please select a Excel spreadsheet to import!');</scr ipt>"); 破坏了网页的html结构。