thanks that works great, aftetr a bit of tweaking:
Here is the code, but how do I make the coloumn Rank (the ones with the rank values in) invisible?
Code:<%@ Page Language="VB" Debug="true" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.OleDb" %> <script runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) ' TODO: Update the ConnectionString and CommandText values for your application Dim MyConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & _ server.mappath("puzzlepirates.mdb")) Dim CommandText As String = "Select Name, Title, Rank from alchemist_guild" Dim myCommand As New OleDBCommand(CommandText, myConnection) myConnection.Open() DGAlchemist.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection) DGAlchemist.DataBind() End Sub </script> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>The Patricians Web</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="tpw.css" type="text/css" rel="stylesheet" /> </head> <body text="#666666" vlink="#333333" alink="#333333" link="#333333" bgcolor="#ffffff" leftmargin="5" topmargin="5" marginwidth="0" marginheight="0"> <form runat="server"> <p> <asp:DataGrid id="DGAlchemist" runat="server" BackColor="LemonChiffon" Width="301px" BorderStyle="None" HorizontalAlign="Left" BorderWidth="0px"> <Columns> <asp:TemplateColumn HeaderText="Rank"> <ItemTemplate> <asp:Image id="Image1" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Rank", "images\image{0}.gif") %>'></asp:Image> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> </p> </form> </body> </html>




Reply With Quote