Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 10th, 2003, 10:00 AM
Registered User
 
Join Date: Jun 2003
Location: Bismarck, ND, USA.
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>
  #2 (permalink)  
Old June 21st, 2003, 02:32 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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
  #3 (permalink)  
Old June 22nd, 2003, 01:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.