Kenn_rosie
New member
- Joined
- Nov 30, 2005
- Messages
- 4
- Programming Experience
- 5-10
I am using msde on win XP pro
I am working in Visual studio 2003. All of the page displays properly except fldDate and FldBlurb is not displaying.
I am trying to extract those two fields from the datbase and show them on the web page.
I placed some data in the fields of the pubs database using interprise manager
Any clues why I cannot see the data on the web page?
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="VB" %>
<HTML>
<HEAD>
<title>My Blog</title>
<script runat="server">
sub Page_Load(Sender as Object, e as EventArgs)
dim i as integer
'set up connection
dim conBlog as new SqlConnection _
("Data Source=Dude;uid= sa; password= girlfriend;" & _
"Initial Catalog=Pubs;")
'get data
dim cmdBlog as new SqlDataAdapter _
("select * from tblWebBlog", conBlog)
'fill dataset
dim dsBlog as DataSet = new DataSet()
cmdBlog.Fill(dsBlog)
'display data
'for i = 0 to dsBlog.Tables(0).Rows.Count - 1
'lblBlurb.Text += dsBlog.Tables(0).Rows(i)("fldDate").ToString() & "<BR>" & dsBlog.Tables(0).Rows(i)("fldBlurb").ToString() + "<p>"
'next i
DataBind()
end sub
</script>
</HEAD>
<body>
<table bgcolor="#ffdd55" width="100%">
<tr>
<td><font size="5">My First ASP.NET Site</font><p></p>
</td></TD></tr>
</table>
<p>
Welcome. You are user
<%# Session.SessionID %>
.<br>
It is currently
<%# DateTime.Now %>
.<br>
Your IP address is
<%# Request.ServerVariables("Remote_Addr") %>
.<p>
<hr>
<table>
<tr>
<td width="200" valign="top" align="right">
<a href="">My Friend's site</a><br>
<a href="">My Other Friend's site</a><br>
<a href="http://www.asp.net ASP.NET site</a><br>
</td>
<td>
<asp:Label id="lblBlurb" runat="server" Width="496px"/>
</td>
</tr>
</table></BODY>
</HTML>
I am working in Visual studio 2003. All of the page displays properly except fldDate and FldBlurb is not displaying.
I am trying to extract those two fields from the datbase and show them on the web page.
I placed some data in the fields of the pubs database using interprise manager
Any clues why I cannot see the data on the web page?
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="VB" %>
<HTML>
<HEAD>
<title>My Blog</title>
<script runat="server">
sub Page_Load(Sender as Object, e as EventArgs)
dim i as integer
'set up connection
dim conBlog as new SqlConnection _
("Data Source=Dude;uid= sa; password= girlfriend;" & _
"Initial Catalog=Pubs;")
'get data
dim cmdBlog as new SqlDataAdapter _
("select * from tblWebBlog", conBlog)
'fill dataset
dim dsBlog as DataSet = new DataSet()
cmdBlog.Fill(dsBlog)
'display data
'for i = 0 to dsBlog.Tables(0).Rows.Count - 1
'lblBlurb.Text += dsBlog.Tables(0).Rows(i)("fldDate").ToString() & "<BR>" & dsBlog.Tables(0).Rows(i)("fldBlurb").ToString() + "<p>"
'next i
DataBind()
end sub
</script>
</HEAD>
<body>
<table bgcolor="#ffdd55" width="100%">
<tr>
<td><font size="5">My First ASP.NET Site</font><p></p>
</td></TD></tr>
</table>
<p>
Welcome. You are user
<%# Session.SessionID %>
.<br>
It is currently
<%# DateTime.Now %>
.<br>
Your IP address is
<%# Request.ServerVariables("Remote_Addr") %>
.<p>
<hr>
<table>
<tr>
<td width="200" valign="top" align="right">
<a href="">My Friend's site</a><br>
<a href="">My Other Friend's site</a><br>
<a href="http://www.asp.net ASP.NET site</a><br>
</td>
<td>
<asp:Label id="lblBlurb" runat="server" Width="496px"/>
</td>
</tr>
</table></BODY>
</HTML>