【发布时间】:2014-05-19 05:47:19
【问题描述】:
请帮我解决我的问题.. 我想在gridview 中检索我的图像,它以图像数据类型 存储在数据库中。 我是新手所以请帮帮我..
SqlConnection conn;
SqlCommand cmd;
SqlDataAdapter adp;
string str;
string strCon = "Data Source=S-PC;Initial Catalog=SA;Integrated Security=True";
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
conn.Open();
str = "SELECT imgg from SA_Stock where '"+DropDownList1.SelectedItem.Text+"";
conn = new SqlConnection(strCon);
cmd=new SqlCommand(str,conn);
adp=new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
GridView1.DataSource = ds.Tables["SA_Stock"];
GridView1.DataBind();
conn.Close();
}
提前感谢您的帮助..
【问题讨论】:
标签: c# asp.net sql drop-down-menu aspxgridview