Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2003, 10:00 AM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default error trying to open a database

Parser Error Message: Could not load type System.Web.UI.WebControls.Data from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

I get the error above when trying to run this code below. Is my code wrong or did my network dude not install the .NET Framework wrong? I am trying to learn .net out of the book "Beginning ASP.Net using VB.Net" I take any help I can get. Thanks for your time.

<script language="vb" runat="server">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
Sub Page_Load(Sender AS Object, E as EventArgs)
    Dim objConnectin As OldDbConnection
    Dim objCommand As OleDbDataAdapter
    Dim strConnect As String
    Dim strComand As String
    Dim DataSet1 As New DataSet

    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
    strConnect += "Data Source="C:\Databases\brian.mdb;"
    strConnect += "Persist Security Info=False"

    strCommand = "SELECT fldTvShows, fldURL FROM TvShows "
    objConnection = New OleDbConnection(strConnect)
    objCommand = New OleDbDataAdapter(strCommand, objConnection)
    objCommand.Fill(DataSet1, "TvShows")
    DataGrid1.DataSource=DataSet1.Tables("TvShows").De faultView
    DataGrid1.DataBind()
End Sub
</script>

<html>
<head>
<title>Data Grid Control example</title>
<body>
<asp:Data Grid id="DataGrid1" runat="server" />
</body>
</head>
</html>
 
Old June 21st, 2003, 02:32 PM
Authorized User
 
Join Date: Jun 2003
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi, How do you know that is where the data base is?
A better way to connect would be sopmething like:

DBConn = New OleDbConnection("PROVIDER=" _
& "Microsoft.Jet.OLEDB.4.0;" _
& "DATA SOURCE=" _
& Server.MapPath("./databases/" _
& "brian.mdb;"))

Hope this helps. - Steve
 
Old June 22nd, 2003, 01:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

The reason for an error you received is in this row:
<asp:Data Grid id="DataGrid1" runat="server" />
As you can see you wrote asp:Data Grid instead of asp:DataGrid and this is interpreted as an attempt to add a control named Data.
And, also, you omited a form tag - u have to enclosed all form elements in form tag.

Regs,

...but the Soon is eclipsed by the Moon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't open database thru VBA sektor Access VBA 1 September 15th, 2008 11:44 AM
Please HELP!!! Cannot open database "ASPState" thuyvncr BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 March 15th, 2007 09:31 PM
Cannot open database with password saikrishnan Pro VB Databases 0 August 26th, 2005 01:47 AM
Attempted to open a database that is already open person747 Access 10 September 3rd, 2004 04:31 PM
Can't open .MDB database saxitalis C# 1 November 7th, 2003 04:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.