我正在使用 MySQL,我在数据库中将图像存储为 varchar
,如何显示这些图像?感谢您的帮助。
我的代码:
public static DataTable GetAllMydetails()
{
string connString = "Server=localhost;database=test;uid=root;";
string query = "SELECT `Mydetails`.`Image`";
MySqlDataAdapter ma = new MySqlDataAdapter(query, connString);
DataSet DS = new DataSet();
ma.Fill(DS);
return DS.Tables[0];
}
protected void Page_Load(object sender, EventArgs e)
{
// I want to display image here on page load...//
}
最佳答案
如何将图像存储在 varchar 中?是说存储图片名称还是转成字节存储?
因为不使用图像数据类型我们不能直接存储图像。
那么你能简短点吗?
关于mysql - 如何使用asp.net显示来自mysql数据库的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32905827/