怎样把数据库里的图片路径读出来显示为图片?

来源:百度知道 编辑:UC知道 时间:2024/06/03 19:20:35
数据库:Access
编程语言:C#
文件格式: .aspx

简单的数据库操作类
public class conn
{
public OleDbConnection con;
public OleDbCommand command;
public OleDbDataReader dr;
public OleDbDataAdapter ada;

public conn()
{
try
{
con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source="+System.Web.HttpContext.Current.Server.MapPath("你的数据库地址"));
con.Open();
}
catch (InvalidOperationException one)
{
System.Web.HttpContext.Current.Response.Write(one.Message);
return;
}
catch (OleDbException two)
{
System.Web.HttpContext.Current.Response.Write(two.Message);
return;
}
}
public void close()
{
con.Close();
}
public void cmd(string str,int m)
{
command = new OleDbCommand(str,con);
try
{
if(m==1)
{
command.ExecuteNonQuery();
}
else
{
dr = command.ExecuteReader();
}
}