473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

display image in datalist through datareader

8
Hi frends....

I'm in a trouble pls help me.....
i need to display smages and the details from database through datalist....
only the images are not displaying....

Here is the code i have given

SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.AppSettings.Get("connectionst ring");
con.Open();
string query = "SELECT [filename],[Name], [Address], [Homecellno], [email] FROM [AddUser]";
SqlCommand ocmd = new SqlCommand(query,con);
SqlDataReader oReader=ocmd.ExecuteReader();


if (oReader.HasRows)
{
dlAgentDetails.DataSource = oReader;
dlAgentDetails.DataBind();

}
Here filename is the field where the images are being stored

Help me pls...
Thank you
Oct 5 '07 #1
2 2201
Hi frends....

I'm in a trouble pls help me.....
i need to display smages and the details from database through datalist....
only the images are not displaying....

Here is the code i have given

SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.AppSettings.Get("connectionst ring");
con.Open();
string query = "SELECT [filename],[Name], [Address], [Homecellno], [email] FROM [AddUser]";
SqlCommand ocmd = new SqlCommand(query,con);
SqlDataReader oReader=ocmd.ExecuteReader();


if (oReader.HasRows)
{
dlAgentDetails.DataSource = oReader;
dlAgentDetails.DataBind();

}
Here filename is the field where the images are being stored

Help me pls...
Thank you
Hi
i m vikas here
I think u can do one thing . U just make the template column in Datalist and inside that template column u write set the value


<itemtemplate>
<%#Eval("fileName")%>
</itemtemplate>

i think it will work

for sure
Oct 5 '07 #2
Dyny
8
Hi
i m vikas here
I think u can do one thing . U just make the template column in Datalist and inside that template column u write set the value


<itemtemplate>
<%#Eval("fileName")%>
</itemtemplate>

i think it will work

for sure


Hi Vivek..


Thanks for your rply..but it didnt work..
i have already given ....<%# DataBinder.Eval(Container,"DataItem.filename")%>
this.....
Oct 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Todd | last post by:
I am somewhat new to ASP.NET and I am probably overlooking some basic rule that's causing my error. Anyways, here's the scoop: I am using a DataReader to access a SQL stored procedure. I want...
1
by: Bigtoga | last post by:
Okay - I'm going crazy here trying to figure out how to do this - here goes: I have a DataList populated by a DataReader. In the DataReader, a column is present called "IsInCategory". I want to...
1
by: Danny Ni | last post by:
Hi, Is there a way to selectively display content of a DataGrid or DataList? Normally I bind them to datareader or datatable, and they will display all the rows, what if I don't want to display...
1
by: B. Sockel | last post by:
I have created a data list and binded it to a data source with no problem, Where i am running into a problem is when i dry and bind a drop down list in Edit mode to a data source. The trick is...
1
by: ae | last post by:
My datareader looks like this where dtrItemList is the datareader and chklExceptionList is my checkboxlist. the rows come in just fine, but I need help also including the name of the columns for...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
1
by: Jameel | last post by:
hello code Gurus, i want to display images in DataList, the image name are stored database, help me please , thanks in advance
16
by: Vikas Kumar | last post by:
i am selectin some data from database and through reader showing it in datalist as above now for radio buttons i have single column which returns 1,2,3 and according to that i want one of above...
5
by: Vikas Kumar | last post by:
i had coded like this <ItemTemplate> <table width="100%"> <tr width="100%"> <td width="25%"><%#DataBinder.Eval(Container.DataItem,"FName")%></td> <td width="25%"><input type=text ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.