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