vb.net web

  • Thread starter Thread starter MArk
  • Start date Start date
M

MArk

I want to connect to a SQL database (Northwind)
I'm using this code example

dim con as new sqlConnection(strConnectionString)
dim cmd as SQLcommand

Etc etc

Now in the example it says to put
<%@ Import Namespace="System.data.sqlClient" %> somewhere

1. I get a squiggly line under sqlConnection
2. Where do I put <%@ Import Namespace="System.data.sqlClient" %>
It doesn't look like VB code to me and I'm wanting to do the web
stuff in VB

Eventually I want to use the datagrid as in the example but there a
big bit i'm missing if i can't get the above to look right


Thank for any help

MArk
 
MArk said:
I want to connect to a SQL database (Northwind)
I'm using this code example

dim con as new sqlConnection(strConnectionString)
dim cmd as SQLcommand

Etc etc

Now in the example it says to put
<%@ Import Namespace="System.data.sqlClient" %> somewhere

Where did you get this from?
1. I get a squiggly line under sqlConnection
2. Where do I put <%@ Import Namespace="System.data.sqlClient" %>
It doesn't look like VB code to me and I'm wanting to do the
web
stuff in VB

Eventually I want to use the datagrid as in the example but there
a big bit i'm missing if i can't get the above to look right

Where do you want to put the code? In a VB source file:

Imports System.data.sqlClient

See also the docs for the Imports statement.
 
Mark,

Try this:

Dim con As New System.Data.SqlClient.SqlConnection(strConnectionString)

Gilles
 
Thanks that worked great.
Is there a way to ref the System.Data.SqlClient
like we do in vb6 with the ado ref


Thanks anyway

Mark
 
Hi Mark,

You can put in top of your program
Imports System.Data.SqlClient

I hope this helps,

Cor
 
Back
Top