error: Declaration expected

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top