终于成功,sql数据库,欢迎大家完善。
Dim cmd As SQLCommand = new SQLCommand()
cmd.C.o.n.n.e.c.t.i.o.n.N.a.m.e = "salaryMS"
Dim dt As DataTable
cmd.CommandText = "s.e.l.e.c.t 文件 from {文件模板} where 文件名 = '考勤导入模板'"
Dim xlsByte() As Byte
dt=cmd.ExecuteReader()
Dim dr As DataRow = dt.DataRows(0)
xlsByte = dr("文件")
Dim fl As String = ProjectPath & "考勤导入模板.xls"
Dim fs As New IO.FileStream(fl,IO.FileMode.Create,IO.FileAccess.Write)
Dim bw As New IO.BinaryWriter(fs)
bw.Write(xlsByte)
bw.Close()
fs.Close()
Dim Proc As New Process '打开文件
Proc.File = fl
Proc.Start()
[此贴子已经被作者于2015/9/24 15:46:59编辑过]