C
Chumley Walrus
I'm trying to display two different datalists on the same page; only
the first datalist displays, while the second does not display (and it
does have data matching the where clause):
<%@ Page Language="vb" Debug="true"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OLEDB" %>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
dim todd = DateTime.Today.ToString ( "d" )
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydbase.mdb;"
Dim strSQL as string ="SELECT article, articleheader, articleID
FROM articles WHERE (dept = 'news') AND (articledate = #" & todd & "#)"
Dim Conn as New OLEDBConnection(strConn)
Dim Cmd as New OLEDBCommand(strSQL,Conn)
Conn.Open()
thedata.DataSource =
Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
thedata.DataBind()
End Sub
</script>
<html>
<head> <title>datalist test</title>
</head>
<body>
<aspataList id="thedata" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
CellSpacing="3">
<ItemTemplate>
<b><%# Container.DataItem("articleheader")%></b>
<br><br><%# Container.DataItem("article")%>
</ItemTemplate>
</ASPatalist>
<script language="VB" runat="server">
sub t2
dim todd2 = DateTime.Today.ToString ( "d" )
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydbase.mdb;"
Dim strSQL as string ="SELECT article, articleheader, articleID
FROM articles WHERE (dept = 'features') AND (articledate = #" & todd2 &
"#)"
Dim Conn as New OLEDBConnection(strConn)
Dim Cmd as New OLEDBCommand(strSQL,Conn)
Conn.Open()
thedata2.DataSource =
Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
thedata2.DataBind()
end sub
</script>
<aspataList id="thedata2" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
CellSpacing="3">
<ItemTemplate>
<b><%# Container.DataItem("articleheader")%></b>
<br><br><%# Container.DataItem("article")%>
</ItemTemplate>
</ASPatalist>
</body></html>
thanks in advance
chumley
the first datalist displays, while the second does not display (and it
does have data matching the where clause):
<%@ Page Language="vb" Debug="true"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OLEDB" %>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
dim todd = DateTime.Today.ToString ( "d" )
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydbase.mdb;"
Dim strSQL as string ="SELECT article, articleheader, articleID
FROM articles WHERE (dept = 'news') AND (articledate = #" & todd & "#)"
Dim Conn as New OLEDBConnection(strConn)
Dim Cmd as New OLEDBCommand(strSQL,Conn)
Conn.Open()
thedata.DataSource =
Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
thedata.DataBind()
End Sub
</script>
<html>
<head> <title>datalist test</title>
</head>
<body>
<aspataList id="thedata" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
CellSpacing="3">
<ItemTemplate>
<b><%# Container.DataItem("articleheader")%></b>
<br><br><%# Container.DataItem("article")%>
</ItemTemplate>
</ASPatalist>
<script language="VB" runat="server">
sub t2
dim todd2 = DateTime.Today.ToString ( "d" )
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\mydbase.mdb;"
Dim strSQL as string ="SELECT article, articleheader, articleID
FROM articles WHERE (dept = 'features') AND (articledate = #" & todd2 &
"#)"
Dim Conn as New OLEDBConnection(strConn)
Dim Cmd as New OLEDBCommand(strSQL,Conn)
Conn.Open()
thedata2.DataSource =
Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
thedata2.DataBind()
end sub
</script>
<aspataList id="thedata2" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
CellSpacing="3">
<ItemTemplate>
<b><%# Container.DataItem("articleheader")%></b>
<br><br><%# Container.DataItem("article")%>
</ItemTemplate>
</ASPatalist>
</body></html>
thanks in advance
chumley