الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

عرض صور محفوظة فى قاعدة بيانات فى gridview

بدأه Moataz Hoossam في 3 ديسمبر 2010 · 1 رد · 648 مشاهدة · في ADO.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

hi i'm trying to show data in gridview through this code but everything appears except the images. I saved the image in sqlserver2005 as Image datatype and when i try to bind the gridview to the db by wizard the images appear when i press test query but nothing when running the app

In Class Named Admin:

public DataTable Select_writer(string writer_name)

{

select_writer_cmd = new SqlCommand();

select_writer_cmd.CommandText="select * from bs where Author = @author";

select_writer_cmd.Connection = new SqlConnection(connectionStr);

da = new SqlDataAdapter();

da.SelectCommand = select_writer_cmd;

select_writer_cmd.Parameters.AddWithValue("@author", writer_name);

ds = new DataSet();

da.Fill(ds);

dt = ds.Tables[0];

sqlConn.Close();

return dt;

}

In Default page:

protected void Button2_Click(object sender, EventArgs e)

{

admin a = new admin();

DataTable dt = a.Select_writer(TextBox2.Text);

GridView1.DataSource = dt;

GridView1.DataBind();

}

#2

Hi

you need to display images using HttpHandler or using another page, you will find an example here

i answered another question like this in ASP.Net forums you will find my answer here

Hope this helps

تم تعديل هذه المشاركة بواسطة Ahmed Moosa في 3 ديسمبر 2010 في 11:51

Ahmed Moosa

Microsoft Community Contributor | MCC

Microsoft Certified Professional Developer | MCPD

Microsoft Certified Technology Specialist | MCTS

Senior .NET Developer

.Net Trainer

English blog : http://weblogs.asp.net/ahmedmoosa/

مدونة عربى : http://ahmedmoosa.wordpress.com/

مواضيع مشابهة