home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
74.208.221.89
/
74.208.221.89.zip
/
74.208.221.89
/
manage
/
importExcelUpload3.aspx
< prev
next >
Wrap
Text File
|
2015-03-13
|
2KB
|
48 lines
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDB" %>
<%@ Import namespace="System.IO" %>
<%@ Import namespace="System.Linq" %>
<%@ Import namespace="DocumentFormat.OpenXml" %>
<%@ Import namespace="DocumentFormat.OpenXml.Packaging" %>
<%@ Import namespace="DocumentFormat.OpenXml.Spreadsheet" %>
<script runat="server">
Dim loc As String
Dim loc1 As String
Dim qr As String
Dim language As String
Dim exclfile As String
Dim exltype As String
Dim fileloc As String
Dim filename As String
Dim sqlstr, sqlstr1 As String
Dim mycon As New conValue()
Dim i As Integer
Sub page_load()
loc = Server.MapPath(".")
exclfile = trim(Request.Querystring("filename"))
fileloc = loc & "\" & exclfile
'----------------
Using spreadsheetDocument As SpreadsheetDocument = spreadsheetDocument.Open(fileName, False)
Dim workbookPart As WorkbookPart = spreadsheetDocument.WorkbookPart
Dim worksheetPart As WorksheetPart = workbookPart.WorksheetParts.First()
Dim reader As OpenXmlReader = OpenXmlReader.Create(worksheetPart)
Dim text As String
While reader.Read()
If reader.ElementType = GetType(CellValue) Then
text = reader.GetText()
Response.Write(text & " ")
End If
End While
'Console.WriteLine()
' Console.ReadKey()
End Using
Response.Write("PRODUCTS ADDED SUCCESSFULLY. You can close this window.")
End Sub
</Script>