Datagrid
using datagrid i want to populate filename from database and files from the web directory folders.
I have filename in the database as Elephant001.jpg
couple image folders l_photos and s_photos. Both folders have same images as c:\inetpub\wwwroot\Photographs\s_photos\Elephant001.jpg
I am doing these:
1. Dim sql As String
sql = "select filename from Photographs"
Dim ds As New DataSet
Dim da As New SqlDataAdapter(sql, con)
da.Fill(ds)
Dim dirinfo As New DirectoryInfo(Server.MapPath("s_photos"))
Me.Photolist.DataSource = ds
Me.Photolist.DataBind()
2. <asp:TemplateColumn HeaderText="FileName">
<ItemTemplate><a href="
http://localhost/Photographs/s_photos/+ '<%#databinder.eval(container.dataitem, "s_photos")%>'" /></a>
</ItemTemplate>
</asp:TemplateColumn>
This is the error i get:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name s_photos.
What am i doing wrong?
Can some one help me. I have not been getting any help so far.
Rani