我正在使用 Visual Studio 2008 。并想连接到数据库。我的应用程序(在 C# 中)是开发一个类似于 Image Viewer 的表单,并执行插入图像和删除图像,以及在数据库中显示图像
问问题
1527 次
2 回答
3
于 2011-07-06T05:41:19.523 回答
0
假设你DBMS
是Sql server
. 你可以做例如
SqlConnection conn = new SqlConnection("connString here");//conn string here
conn.Open();//if using SqlDataReader
SqlCommand cmd = new SqlCommand("your query", conn);///your command object
....
.....
为了将图像插入数据库,主要有两个选项,要么将 保存image path
在数据库中,要么将图像本身保存在数据库中BLOB
。
于 2011-07-06T05:42:15.710 回答