Hi everyone,
Im still working around the new features of .net and have created a dataset and i use the repeater to dynamically create a table. It all works fine, but now i need some logic to not display the repeater if not records are found. How do findout how many records are found.
Thanks Tim
***CODE BELOW***
<script language="
vb" runat="server">
Sub Page_Load
If Not Page.IsPostBack Then
Dim objConn, strSQL, DBComm, DBRead, TID, CollectionName, CollectionImageLarge
TID = Request.Form("TID")
ViewState("CollectionName") = Request.Form("CollectionName")
ViewState("CollectionImageLarge") = Request.Form("CollectionImageLarge")
objConn = New OledbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\veroniqueparis\database\ VeroniqueParisDB.mdb")
objConn.Open()
strSQL = "SELECT * FROM tblTasselItems WHERE TasselCollectionID = " & TID & " ORDER BY TasselItemID"
DBComm = New OleDbCommand(strSQL,objConn)
DBRead = DBComm.ExecuteReader()
tassel.DataSource = DBRead
tassel.DataBind()
DBRead.Close()
objConn.Close()
End If
End Sub
</script>
*** Repeater Code ****
<asp:Repeater ID="tassel" runat="server">
<headertemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000"><tr class="pageheaders">
<th width="15%" scope="col"><span class="style11">ITEM No. </span></th>
<th width="55%" scope="col"><span class="style11">Description</span></th>
<th width="15%" scope="col"><span class="style11">No. per pack </span></th>
<th width="15%" scope="col"><span class="style11">size</span></th>
</tr>
</headertemplate>
<itemtemplate>
<tr bgcolor="#FDFCF2">
<td width="15%"><span class="style19"><%# Container.DataItem"TasselItem") %></span></td>
<td width="52%"><span class="style19"><%# Container.DataItem("TasselDescription") %></span></td>
<td width="18%" align="center"><span class="style19"><%# Container.DataItem("TasselPack") %></span></td>
<td width="15%" align="center"><span class="style19"><%# Container.DataItem("TasselSize") %></span></td>
</tr>
</itemtemplate>
<footertemplate></table></footertemplate>
</asp:Repeater>
TDA