本文介绍了要存储和检索excel/doc/pdf文件或其他exe到sql2000数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个excel文件/位置中存在其他应用程序exe文件.
我想将文件从SQL2000数据库存储/检索到SQL2000数据库中,而不是图像.
我将如何解决以上问题????
为方便起见,请帮助我进行任何说明.......
I have a excel file/Other application exe file are existing in location.
I want to store/retrive that files from/into SQL2000 Database, but not image.
How will i do above problem??????
Please help me any instruction for my convenience.......
推荐答案
Imports System.Data.SqlClient
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim fBrowse As New OpenFileDialog
With fBrowse
.Filter = "Excel files(*.xlsx)|*.xlsx|All files (*.*)|*.*"
.FilterIndex = 1
.Title = "Import data from Excel file"
End With
If fBrowse.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim fname As String
fname = fBrowse.FileName
MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source='" & fname & " '; " & "Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1
这篇关于要存储和检索excel/doc/pdf文件或其他exe到sql2000数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!