473,378 Members | 1,067 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Help with the ASP Web Matrix

I seem to have a problem with Web Matrix.
When attempting to write the line:
Imports System.Data.SQLClient at the top of my code, this
doesnot seem to be taking. How do I know?
When attempted to run a Microsoft example of executing an
example from ASP.Net I am getting pounded with errors on
code that is correct. This is the Microsoft example code.

Dim sConnectionString As String = _
"server=localhost;uid=sa;pwd=;database=Northwi nd"
Dim cnNorthwind As New SqlConnection(sConnectionString)
Dim cmdOrders As New SqlCommand("CustOrderHist",
cnNorthwind)
cmdOrders.CommandType = CommandType.StoredProcedure
' Set up parameter for stored procedure
Dim prmCustomerID As New SqlParameter()
prmCustomerID.ParameterName = "@CustomerID"
prmCustomerID.SqlDbType = SqlDbType.VarChar
prmCustomerID.Size = 5
prmCustomerID.Value = "ALFKI"
cmdOrders.Parameters.Add(prmCustomerID
These are my errors:

C:\BegASPNET11\Ch04\mark.aspx(6) : error BC30002:
Type 'SqlConnection' is not defined.

Dim cnNorthwind As New SqlConnection
(sConnectionString)

~~~~~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(7) : error BC30002:
Type 'SqlCommand' is not defined.

Dim cmdOrders As New SqlCommand("CustOrderHist",
cnNorthwind)

~~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(8) : error BC30188:
Declaration expected.

cmdOrders.CommandType = CommandType.StoredProcedure
~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(10) : error BC30188:
Declaration expected.

cmdOrders.Parameters.Add(New _
~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(12) : error BC30188:
Declaration expected.

cmdOrders.Parameters("@CustomerID").Value = "ALFKI"
~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(14) : error BC30002:
Type 'SqlDataAdapter' is not defined.

Dim daGetOrders As New SqlDataAdapter(cmdOrders)
~~~~~~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(15) : error BC30002:
Type 'DataSet' is not defined.

Dim dsOrders As New DataSet()
~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(16) : error BC30188:
Declaration expected.

daGetOrders.Fill(dsOrders, "Orders")
~~~~~~~~~~~
C:\BegASPNET11\Ch04\mark.aspx(17) : error BC30188:
Declaration expected.

DataGrid1.DataSource = dsOrders.Tables("Orders")
~~~~~~~~~

Nov 22 '05 #1
1 1493
Jeff,

When you place messages in this newsgroup don't tell that you use Web
Matrix.
Most of people active in this newsgoup use Visual Studio Net what is another
approach of dotNet.

A good newsgroup for your needs is in my opinion.
Aspnet
news://msnews.microsoft.com/microsof...amework.aspnet

Web interface:
http://communities2.microsoft.com/co...amework.aspnet

A good base of information
http://samples.gotdotnet.com/quickstart/

The samples on MSDE are partially based on the scripting style you use and
partially on the Visual.Studio Net style. What is in my opinion very
confusing when you don't know that.

You miss probably at least in your program the import of the namespaces in
top of your program
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

I hope this helps?

Cor
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Silver | last post by:
First of all...merry christmas everyone! Now, I have to write a program. Among other things, I need to overload the '*' operator, so that it returns a pointer-to-ponter of type int, which is...
5
by: Jason | last post by:
Hello. I am trying to learn how operator overloading works so I wrote a simple class to help me practice. I understand the basic opertoar overload like + - / *, but when I try to overload more...
16
by: laclac01 | last post by:
I have developed my own copy function for coping my own dynamic memory structure. It works, but I feel its not too efficient. There must be a quicker way to copy the data. In some of the...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
5
by: mohammaditraders | last post by:
Write a program which overloads a binary Minus (-) operator, The program will contain a class Matrix, This class will contain a private data member Array which store int values. The class will...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.