G
Guest
I have developed in ASP in the past and am now getting into ASP.Net and have
hit a road block. I've been reading tutorias and documents and am still
having problems. I have the following code example:
****************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
MyConnection = New
SqlConnection("server=sqlserver;database=sales;Trusted_Connection=Yes")
MyCommand = New SqlDataAdapter("select * from orders where orderid =
32000", MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Orders")
Repeater2.DataSource = DS
Repeater2.DataBind()
End Sub
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="orders.aspx.vb"%>
<HTML>
<HEAD>
<title>orders</title>
</HEAD>
<body>
<form runat="server">
<asp:Repeater id="Repeater2" runat="server">
<HeaderTemplate>
<Table width="100%" style="font: 8pt verdana">
<tr>
<th>
Order ID
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem, "OrderID") %>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></TD>
</form>
</body>
</HTML>
************************************************
This code looks good to me but when I run this, I do not get anything on the
page (blank). Here is the html after I run it:
<HTML>
<HEAD>
<title>orders</title>
</HEAD>
<body>
<form name="_ctl0" method="post" action="orders.aspx" id="_ctl0">
<input type="hidden" name="__VIEWSTATE"
value="dDw1NzE5OTAzNTI7Oz6dpCg+ix9Yj9gsw5NbtgI82h5suw==" />
</TD>
</form>
</body>
</HTML>
I just cant understand why I am not getting any data.
Any help would be much appreciated.
hit a road block. I've been reading tutorias and documents and am still
having problems. I have the following code example:
****************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
MyConnection = New
SqlConnection("server=sqlserver;database=sales;Trusted_Connection=Yes")
MyCommand = New SqlDataAdapter("select * from orders where orderid =
32000", MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Orders")
Repeater2.DataSource = DS
Repeater2.DataBind()
End Sub
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="orders.aspx.vb"%>
<HTML>
<HEAD>
<title>orders</title>
</HEAD>
<body>
<form runat="server">
<asp:Repeater id="Repeater2" runat="server">
<HeaderTemplate>
<Table width="100%" style="font: 8pt verdana">
<tr>
<th>
Order ID
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem, "OrderID") %>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater></TD>
</form>
</body>
</HTML>
************************************************
This code looks good to me but when I run this, I do not get anything on the
page (blank). Here is the html after I run it:
<HTML>
<HEAD>
<title>orders</title>
</HEAD>
<body>
<form name="_ctl0" method="post" action="orders.aspx" id="_ctl0">
<input type="hidden" name="__VIEWSTATE"
value="dDw1NzE5OTAzNTI7Oz6dpCg+ix9Yj9gsw5NbtgI82h5suw==" />
</TD>
</form>
</body>
</HTML>
I just cant understand why I am not getting any data.
Any help would be much appreciated.