从sql server 2008获取数据(包含int,string和image)并将其导出到csv或xml,然后将其用作数据库 [英] Fetch data(containg int, string and image) from sql server 2008 and export it to csv or xml and than use that as database

查看:98
本文介绍了从sql server 2008获取数据(包含int,string和image)并将其导出到csv或xml,然后将其用作数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序必须从SQL Server 2008获取数据库并将其导出为CSV或XML,然后将导出的数据库用作应用程序的数据库并显示与任何ID相对应的详细信息。所有工作正常,但保存在sql db image数据类型保存图像<二进制数据>它以csv的形式保存为字符串,因此如何在pictureBox中显示该图像。实际上另一个应用程序是用于Windows CE兼容设备,它只能支持CSV或XML或任何相同类型。

我的数据字段是整数,字符串和图像。

My application has to fetch database from SQL Server 2008 and export it to CSV or XML and than use that exported one as database for the application and display the details corresponding to any id. All working fine but when saved in sql db image datatype saves images in <Binary data> which is saved in csv as string, so how to display that image in pictureBox. Actually the another app is for windows CE compatible device which can only support CSV or XML or any of same kind.
My data fields are integer, string and image.

推荐答案

对于图像,您必须采取不同的方式。



1.从SQL获取数据

2.获取图像为二进制,准备图像并存储在一个文件夹中

3.将文件夹路径写入CSV
For image you have to do differently.

1. Fetch Data from SQL
2. Get the Image as binary , prepare image & store in a folder
3. Write folder path to CSV


你好



对于图像,您必须采取不同的方式。



1.从SQL中获取数据

3.创建XML或CSV文件。





想要显示图像将Base64String转换为字节数据并显示为图像。
Hello

For image you have to do differently.

1. Fetch Data from SQL
2. Get the Image as binary and convert binary data to Base64String.
3. Create XML or CSV file.


When want to display the image the convert Base64String to byte data and display as image.


这篇关于从sql server 2008获取数据(包含int,string和image)并将其导出到csv或xml,然后将其用作数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆