问题描述
亲爱的,
我开发了一个使用Ms SQL Server的系统。图像也作为BOLB存储在数据库中。我正在使用与VB 2005捆绑在一起的水晶报告。我正在使用数据集(创建一个表,添加了列),然后使用SQL查询从数据库填充数据表。当我运行除图片之外的水晶报告时,所有信息都可用。你能告诉我如何填充数据集以便显示图片吗?
i have developed a system that uses Ms SQL Server. the images are also stored as BOLB in the database. i am using crystal reports bundled with VB 2005. i am using a dataset (Created a table, added the columns) and then filled the datatable from the database using a SQL query. all the information is available when i run the crystal report except the Picture. could you please let me know as to how i should fill the dataset so that the picture is displayed ?
代码看起来像这样填充数据集:
the code looks something like this to fill the dataset:
Dim strQuery As String = _
Dim strQuery As String = _
" SELECT SlNo,IDNew,FirstName,MiddleName,LastName, Photo" _
" SELECT SlNo, IDNew, FirstName, MiddleName,LastName, Photo " _
& " FROM Tbl_StaffDetails"
Dim sqlConn As 新 SqlConnection(strConnStr)
Dim sqlConn As New SqlConnection(strConnStr)
Dim sqlCmd As 新 SqlCommand(strQuery,sqlConn)
Dim sqlCmd As New SqlCommand(strQuery, sqlConn)
Dim myDA As 新 SqlDataAdapter
Dim myDA As New SqlDataAdapter
myDS2.Clear()
myDS2.Clear()
尝试
Try
myDA.SelectCommand = sqlCmd
myDA.SelectCommand = sqlCmd
myDA.Fill(myDS2, " tbl_OfficeStaff" )
myDA.Fill(myDS2, "tbl_OfficeStaff")
Catch ex As Exception
Catch ex As Exception
MessageBox.Show(ex.Message.ToString)
MessageBox.Show(ex.Message.ToString)
结束 尝试
End Try
推荐答案
这篇关于ADO.NET数据表BLOB字段Crystal报表显示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!