Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.1
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 January 22nd, 2005, 09:54 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default character is not valid chp 2- (beginner, plz help)

I just picked up the book today and I'm running through the examples. The datacontrolMDX example is blowing up on me saying invalid character on line 4. Here's my code...
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>
<script language = "vb" runat = "server" debug = "true">
sub page_load (Sender as object, E as EventArgs)
    Dim objConnectoin As OleDbConnection
    Dim objCommand As OleDbDataAdapter
    Dim strConnect As String
    Dim srCommond As String
    Dim DataSet1 As New DataSet
    strConnect="Provider=Microsoft.Jet.OLEDB.4.0;"
    strConnect += "Data Source=C:\BegASPNET11\grocertogo.mdb;"
    strConnect += "Persist Security Info=False"
    strCommand = "SELECT ProductName, UnitPrice FROM Products"
    objConnect = New OleDbConnection (strConnect)
    objCommand = New OleDbDataAdapter(strCommand, objConnection)
    objComman.Fill(DataSet1, "products")
    DataGrid1.DataSource=DataSet1.Tables("Products").D efaultView
    DataGrid1.DataBind()
End Sub


Here's the error...
Compiler Error Message: BC30037: Character is not valid.

Source Error:

Line 2: <script runat="server">
Line 3:
Line 4: <%@ import Namespace="System.Data" %>
Line 5: <%@ import Namespace="System.Data.OleDb" %>
Line 6: <script language = "vb" runat = "server" debug = "true">

Source File: C:\BegASPNet11\Ch02\datacontrolMDB.aspx Line: 4
 
Old January 22nd, 2005, 11:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The import statements must be at top, below the page declaration. They can't be in the script block.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
plz.....plz solve out my problem.... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 October 4th, 2007 12:56 PM





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