1.使用PHP
成都网站设计、网站建设的关注点不是能为您做些什么网站,而是怎么做网站,有没有做好网站,给创新互联建站一个展示的机会来证明自己,这并不会花费您太多时间,或许会给您带来新的灵感和惊喜。面向用户友好,注重用户体验,一切以用户为中心。
Excel Parser Pro软件,但是这个软件为收费软件;
2.可将EXCEL表保存为CSV格式,然后通过phpmyadmin或者SQLyog导入,SQLyog导入的方法为:
·将EXCEL表另存为CSV形式;
·打开SQLyog,对要导入的表格右击,点击“导入”-“导入使用加载本地CSV数据”;
·在弹出的对话框中,点击“改变..”,把选择“填写excel友好值”,点击确定;
·在“从文件导入”中选择要导入的CSV文件路径,点击“导入”即可导入数据到表上;
用System.IO.StreamReader类可以读各类文本文件,用System.IO.StreamWriter 类则可以写各类文本文件,从而实现导入导出文本文件功能。这两个类均支持各类编码格式(默认的是Unicode和UTF-8)。
解题思路:
把EXCEL看做数据源来连接。
用一个list来显示EXCEL中的所有表,选择指定表名,打开EXCEL到DG
——————————如下:
引用ADODB 2.8
导入:
Imports System.Data
Imports System.Data.Odbc
Imports System.Data.OleDb
申明
Private Excelpath As String
Public conn As New ADODB.Connection
Public rs As New ADODB.Recordset
创建conn
Public Sub connDB(ByVal filePath As String)
On Error Resume Next
Dim strConnString As String = "Provider=microsoft.ace.oledb.12.0;Data Source=" filePath ";Extended Properties='Excel 12.0; HDR=yes;IMEX=1';"
conn.ConnectionString = strConnString
conn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
conn.Open()
End Sub
Public Function 获取电子表集合(filePath) As List(Of String)
Dim ConnStr As String = "Provider=microsoft.ace.oledb.12.0;Data Source=" filePath ";Extended Properties='Excel 12.0; HDR=no;IMEX=1';"
Dim list As New List(Of String)()
Dim Conn2 As New OleDbConnection(ConnStr)
Try
If Conn2.State = ConnectionState.Closed Then
Conn2.Open()
End If
Dim dt As DataTable = Conn2.GetSchema("Tables")
For Each row As DataRow In dt.Rows
If row(3).ToString() = "TABLE" Then
list.Add(row(2).ToString())
End If
Next
Catch e As Exception
'Throw e
Finally
If Conn2.State = ConnectionState.Open Then
Conn2.Close()
End If
Conn2.Dispose()
End Try
Return list
End Function
//////////////////
开始打开指定EXCEL到DG
Call connDB(Excelpath)
Dim sqlstr As String = "select * from [" Me.ListBox1.Text "]"
With rs
If rs.State 0 Then rs.Close()
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
.Open(sqlstr, conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
If Not rs.EOF And Not rs.BOF Then
Dim da As New System.Data.OleDb.OleDbDataAdapter
Dim ds As New DataSet
da.Fill(ds, rs, "注册表")
DG.DataSource = Nothing
DG.DataSource = ds.Tables(0)
DG.Refresh()
End If
End With