将excel导入access的问题 - .NET技术 / ASP.NET
VB.NET code:
Public Class excelAccess
Public Function exceltoTb(ByVal strExcelFileName As String, ByVal strSheetName As String) As System.Data.DataTable
Dim cnnStr As String = "Provider=Microsoft.Jet.OleDb.4.0;" & "Data Source=" & strExcelFileName & ";Extended Properties=Excel 5.0;"
Dim cnn As OleDbConnection = New OleDbConnection(cnnStr)
cnn.Open()
Dim strExcel As String = Format("select * from [{0}$]", strSheetName) '"select * from [sheet1$]"
Dim ds As System.Data.DataSet = New System.Data.DataSet
Dim apt As OleDbDataAdapter = New OleDbDataAdapter(strExcel, cnn)
apt.Fill(ds, strSheetName)
cnn.Close()
exceltoTb = ds.Tables(strSheetName)
End Function
Public Sub tbToAcc(ByVal username As String)
Dim cnnStr As String = "Privoder=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & System.Web.HttpContext.Current.Server.MapPath("NJUTDW.MDB") & ";Extended Properties=Excel 5.0;"
Dim cnn As OleDbConnection = New OleDbConnection(cnnStr)
cnn.Open()
Dim strCmd As String = "insert into users(username,pwd) values('" & username & "','" & username & "')"
Dim cmd As OleDbCommand = Ne
相关问答:
调整了这里,那里出问题。
有没有什么好的方法,像调整对话框一样????
找个专门做页面的
在dreamweaver里调。。。也可以直接控制HTML代码
确实痛苦 感同身受呀
哈哈 坚决路过。
用DW吧,VS搞设计 ......
本人工作经验一年以上
熟悉asp.net
熟悉javascript
熟悉Css
熟悉ajax
熟悉sqlserver2005
有一年的项目经验
具体项目和其他的就不在这写了
有意者联系:
QQ:359233910
引用
本人工作经验一年以上
熟悉asp ......
asp.net批量上传图片最好有源码,在线等!!!!!!!
源码很长的。
参考
C# code:
HttpFileCollection files = HttpContext.Current.Request.Files;
if (files.Count <= 1)
{
......