Hello, I'm using the Repeater control to display pictures from a SQL database. Now I'd like to format it in a neat grid table. Right now, it's displaying this:
pictures are the x's:
x x x x x x x
i want it to look like this:
x x x x
x x x x
x x x x
Problem is, it doesn't go to the next record, so what is the command for next record? I'm trying to accomplish this:
Any help thank you very very much!!!!
*************
ASP.NET Code
************
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
' Create a connection to the "pubs" SQL database located
' on the local computer.
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
' Connect to the SQL database using a SQL SELECT query to get
' all the data from the "Titles" table.
myConnection = New SqlConnection("server=24.136.102.162;" _
& "database=usedpianos;user id=sa;pwd=XXXXXXXX")
myCommand = New SqlDataAdapter("SELECT * FROM data", _
myConnection)
' Create and fill a DataSet.
Dim ds As Dataset = new DataSet()
myCommand.Fill(ds)
' Bind MyRepeater to the DataSet. MyRepeater is the ID of the
' Repeater control in the HTML section of the page.
MyRepeater.DataSource = ds
MyRepeater.DataBind()
End SUb
</script>
<html>
<head>
</head>
<body>
<asp:Repeater id="myrepeater" runat="server">
<itemtemplate>
<img src="<%# DataBinder.Eval(Container.DataItem, "gridpix") %>">
</itemtemplate>
</asp:Repeater>
</body>
</html>
pictures are the x's:
x x x x x x x
i want it to look like this:
x x x x
x x x x
x x x x
Problem is, it doesn't go to the next record, so what is the command for next record? I'm trying to accomplish this:
Any help thank you very very much!!!!
*************
ASP.NET Code
************
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
' Create a connection to the "pubs" SQL database located
' on the local computer.
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
' Connect to the SQL database using a SQL SELECT query to get
' all the data from the "Titles" table.
myConnection = New SqlConnection("server=24.136.102.162;" _
& "database=usedpianos;user id=sa;pwd=XXXXXXXX")
myCommand = New SqlDataAdapter("SELECT * FROM data", _
myConnection)
' Create and fill a DataSet.
Dim ds As Dataset = new DataSet()
myCommand.Fill(ds)
' Bind MyRepeater to the DataSet. MyRepeater is the ID of the
' Repeater control in the HTML section of the page.
MyRepeater.DataSource = ds
MyRepeater.DataBind()
End SUb
</script>
<html>
<head>
</head>
<body>
<asp:Repeater id="myrepeater" runat="server">
<itemtemplate>
<img src="<%# DataBinder.Eval(Container.DataItem, "gridpix") %>">
</itemtemplate>
</asp:Repeater>
</body>
</html>