Can anyone help with Visual Studio?
I have the following result for the Wrox United Players page with a whole load of Result data added, how can I stop this appearing and what generates it?
************************************************** ************
Wrox United
Players
PlayerID PlayerName Profile JoinDate
1 Chris Hart Enter profile here 1/1/2003 00:00:00
2 Chris Ullman Excellent forward 1/1/2003 00:00:00
3 Dave Sussman Good in defence 1/1/2003 00:00:00
4 John Kauffman Recommended in goal 1/1/2003 00:00:00
--------------------------------------------------------------
Request Details
Session Id: nb104fzs5savar55da5tgn2m Request Type: GET
Time of Request: 7/13/2004 21:21:55 Status Code: 200
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init
aspx.page End Init 0.000043 0.000043
aspx.page Begin PreRender 0.051637 0.051594
aspx.page End PreRender 0.051720 0.000084
aspx.page Begin SaveViewState 0.053210 0.001489
aspx.page End SaveViewState 0.053841 0.000632
aspx.page Begin Render 0.053899 0.000058
aspx.page End Render 0.056019 0.002120
Control Tree
Control Id Type Render Size Bytes (including children) Viewstate Size Bytes (excluding children)
__PAGE ASP.Players_aspx 2661 20
_ctl0 System.Web.UI.LiteralControl 46 0
Form1 System.Web.UI.HtmlControls.HtmlForm 2594 0
_ctl1 System.Web.UI.LiteralControl 76 0
DataGrid1 System.Web.UI.WebControls.DataGrid 589 656
DataGrid1:_ctl0 System.Web.UI.WebControls.DataGridTable 589 0
DataGrid1:_ctl1 System.Web.UI.WebControls.DataGridItem 86 0
DataGrid1:_ctl1:_ctl0 System.Web.UI.WebControls.TableCell 19 0
DataGrid1:_ctl1:_ctl1 System.Web.UI.WebControls.TableCell 19 0
DataGrid1:_ctl1:_ctl2 System.Web.UI.WebControls.TableCell 16 0
-----------------------------------------------------------------
My code is as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
<%@ Page Language="
VB" Debug="true" Trace="true" %>
<%@ Import Namespace="System.Data.Oledb" %>
<%@ Import Namespace="System.Data" %>
<script runat="server">
Sub Page_Load(Sender As Object, e As EventArgs)
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\BegASPNET11\WroxUnited\Database\WroxUnit ed.mdb"
Dim dbConnection As New OleDbConnection(ConnectionString)
Dim queryString As String = _
"Select PlayerID, PlayerName, Profile, JoinDate FROM Players"
Dim dbCommand As New OleDbCommand
dbCommand.CommandText = queryString
dbCommand.connection = dbConnection
Dim dataAdapter As New OleDbDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim data As DataSet = New System.Data.DataSet
dataAdapter.Fill(Data, "Players")
DataGrid1.DataSource = data.tables("Players")
DataGrid1.DataBind()
dbCommand.connection.Close()
dbConnection.Close()
End Sub
</script>
<HTML>
<HEAD>
</HEAD>
<body>
<form runat="server" ID="Form1">
<h1>Wrox United
</h1>
<h2>Players
</h2>
<p>
<asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid>
</p>
</form>
</body>
</HTML>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
It is derived from an earlier chapter (I wasn't sure which line to use to close the connection? Either of the first or second lines or both, makes no difference to the result)
Not using Web matrix I don't have the wizard that built the code listed in pages 372 & 373 apart from which some of the controls like </wmx:AccessDataSourceControl> does not appear to be part of Visual Studio's controles?
Can anyone through any light on my problem?
Regards,
Edward.