error: Declaration expected

  • Thread starter Thread starter phil
  • Start date Start date
P

phil

Hi,

When executing this (asp.net 2.0), i get the error:
Compiler Error Message: BC30188: Declaration expected.
Line 9: Dim dtreader As SqlDataReader
Line 10:
Line 11: db = new Sqlconnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\access\nemi.mdb")
Line 12:
Line 13:
Source File: D:\Inetpub\wwwroot\aspnet\Begin\Chapter07\access2.aspx Line:
11

but db is declared with: Dim db As SqlConnection??
Thanks
Phil

This is the code:
<%@ Page Language="VB" %>
<%@ import namespace="System.Data"%>
<%@ import namespace="System.Data.SqlClient"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Dim db As SqlConnection
Dim comm As SqlCommand
Dim dtreader As SqlDataReader
db = new SqlConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\access\nemi.mdb")
</script>
 
Back
Top