473,385 Members | 2,044 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,385 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 1495
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.