本文介绍了如何在VB中从SQL服务器检索文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在datagridview中检索word文档而不是图像。请帮我!!
我的数据库名称是testattach,我的表名是FileWarehouse。在我的表中,有id,filetype和storedfile。存储的文件在word doc中。
当我尝试运行此代码时,它会显示除存储文件以外的所有内容,但我无法打开它。请尽快帮助我
我的尝试:
I want to retrieve word document and not image in a datagridview. Please help me!!
My database name is testattach and my table name is FileWarehouse. In my table, there are id, filetype and the storedfile. the stored file is in word doc.
When I try to run this code, it displays everything except for the stored file and I cannot open it. Please Help me ASAP
What I have tried:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = "Server = HRCS-SGH447S14G\COMPASS; Database = testattach; Integrated Security = true"
Dim con As New SqlConnection(str)
Dim com As String = "Select * from FileWarehouse "
Dim Adpt As New SqlDataAdapter(com, con)
Dim ds As New DataSet()
Adpt.Fill(ds, "FileWarehouse")
DataGridView1.DataSource = ds.Tables(0)
End Sub
推荐答案
这篇关于如何在VB中从SQL服务器检索文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!