From the http://msdn.microsoft.com/en-us/library/bb384469.aspx (Walkthrough: Creating Stored Procedures for the Northwind Customers Table, I copied the following sql code:
--UpdateSPforNWcustomersTable.sql--
USE NORTHWIND
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'SelectCustomers' AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.[SelectCustomers]
GO
CREATE PROCEDURE dbo.[SelectCustomers]
AS
SET NOCOUNT ON;
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM dbo.Customers
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'InsertCustomers' AND user_name(uid) = 'dbo')
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers WHERE (CustomerID = @CustomerID)
GO
==================================================================================== I executed the above code in my SQL Server Management Studio Express (SSMSE) and I got the following error messages:
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'NORTHWIND'. No entry found with that name.
Make sure that the name is entered correctly.
=============================================================================================================== I know I recreated the NORTHWIND Database from a different Database before and I did not do anything for the entry in sysdatabases. How can I change the entry in sysdatabases for database 'NORTHWIND' now? Please help and advise.
I've running MSDE on a win xp box with SP2. The SQL server service manager indicates that the SQL server is running. I'm using Visual Studio 2003. According to the install page for 101 VB and C# Code Samples I should install the .NET frameword samples db.. See http://www.microsoft.com/downloads/details.aspx?FamilyId=08E3D5F8-033D-420B-A3B1-3074505C03F3&displaylang=en
I cd to the appropriate dir and run osql -E -S (local)NetSDK -i InstNwnd.sql (the cmd given on the page noted above). I get the following error:
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:Program FilesMicrosoft Visual Studio .NET 2003SDKv1.1SamplesSetup>osql - E -S (local)NetSDK -i InstNwnd.sql [DBMSLPCN]SQL Server does not exist or access denied. [DBMSLPCN]ConnectionOpen (Connect()).
C:Program FilesMicrosoft Visual Studio .NET 2003SDKv1.1SamplesSetup>
I'm a newbie to .NET and SQL server so this makes no sense to me. If the SQL server service manager indicates that the SQL server is running why do I get that error and what is the work around?
Thanks .NET great ones for helping a newbie get off the ground...
I try to learn "How to Access Stored Procedures with ADO.NET 2.0 - VB 2005 Express: (1) Handling the Input and Output Parameters and (2) Reporting their Values in VB Forms". I found a good article "Calling Stored Procedures from ADO.NET" by John Paul Cook in http://www.dbzine.com/sql/sql-artices/cook6. I downloaded the source code into my VB 2005 Express:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Public Class Form_Cook
Inherits System.Windows.Form.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents labelPAF As System.Windows.Forms.Label
Friend WithEvents labelNbrPrices As System.Windows.Forms.Label
Friend WithEvents UpdatePrices As System.Windows.Forms.Button
Friend WithEvents textBoxPAF As System.Windows.Forms.TextBox
Friend WithEvents TenMostExpensive As System.Windows.Forms.Button
Friend WithEvents grdNorthwind As System.Windows.Forms.DataGrid
Friend WithEvents groupBox2 As System.Windows.Forms.GroupBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.labelPAF = New System.Windows.Forms.Label()
Me.labelNbrPrices = New System.Windows.Forms.Label()
Me.textBoxPAF = New System.Windows.Forms.TextBox()
Me.UpdatePrices = New System.Windows.Forms.Button()
Me.groupBox2 = New System.Windows.Forms.GroupBox()
Me.TenMostExpensive = New System.Windows.Forms.Button()
Me.grdNorthwind = New System.Windows.Forms.DataGrid()
) ================================================= In my VB 2005 Express, I created a project "KimmelCallNWspWithAdoNet" that had the following code: --Form_Kimmel.vb-- Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Public Class Form_Kimmel
Public Sub InsertCustomer()
Dim connectionString As String = "Integrated Security-SSPI;Persist Security Info=False;" + _
End Class ==============================================
I executed the Form_Kimmel.vb and I got no errors. But I did not get the new values insterted in the table "Custermers" of Northwind database. Please help and tell me what I did wrong and how to correct this problem.
I have to do an exercize where i am using Northwind sample database. I am normally accustomed to linking to a database on another server. Is there a way i can just include the Northwind database to my project. In general, I need to find out how to link to the Northwind db so I can start querying and processing data. thanks for your help
I want use the the Northwind database do some example! I had installed the Visual Web Deveplopment Express Edition and installed the SQL Server 2005 Express Edition .but I build one new Website and connect the Northwind database but i can't find the it from the Database Explorer.why?
sara writes "Dear Sir/Madam, I use Sql Server 2005.I want to use Northwind Database & I have it but I could not Execute That It is the error: Msg 911, Level 16, State 1, Line 1 Could not locate entry in sysdatabases for database 'NorthwindCS'. No entry found with that name. Make sure that the name is entered correctly.
Hi I have just started using the SQL Server 2005 Express Edition and wondering how to install the InstNwnd.sql from the sql file. I can't find any way to insert the database
I'm installing Northwind Database onto Local Computer. The Computer's Name is (Localhost)The Installation Menu is asking to for the [Enter Name of the (Server)] "______________________" Am I correct in assuming to Enter Localhost - for the [Enter Name of the (Sever)]. "___Localhost_____" Can someone comfirm as to whether this is correct or not... Thank You.
I have asked for the following questions and I need your advises.Utilizing the Northwind database suppied with SQL Server, create SQL tosolve each of the exercises listed.1.I want to contact all customers who have received over $1,000 indiscounts on orders this year. Give me the name and phone number of theperson to contact at the customers site. Also, list the orders wherethe total discount was greater than $100. Remember, discount is apercentage of the price.2.Give me a list of suppliers and products where we do not have thestock on hand to fill the orders to be shipped. List out the customerand order information for each of the products involved.3.Give me a list of all orders that were shipped after the requireddate for the week of Jan 7, 2001. I want to know the name of theemployees that were responsible for the orders.4.We are having a golf tournament and I need some prizes. Give me alist of the top 5 shippers by dollar amount in the last year.5.Some customers are taking us for a ride on shipping. Give me a listof customers and the orders involved where more than ½ of their ordersare being shipped to a region other than their home region.Please advise ...thanks a lot
i am getting an error ... given below and my web.config is also given below
can any one help me is my connection string right ... i am using sql server 2005 .. my system name is soft18 ..
Server Error in '/prjLogin' Application.
Cannot open database "Northwind" requested by the login. The login failed. Login failed for user 'SOFT18Administrator'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed. Login failed for user 'SOFT18Administrator'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Cannot open database "Northwind" requested by the login. The login failed. Login failed for user 'SOFT18Administrator'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +115 System.Data.SqlClient.TdsParser.ThrowExcepti.................... ........................ ................ ...................
I just downloaded and installed MSDE2000 sp3a for winform and asp.net quickstart tutorial. But I found it has no sample database such as pubs and northwind. It used to have these databases. At least in last September when .Net web Matrix came out.
If this is the case, can someone tell me where to get the sql scripts to create Northwind database in MSDE? Becasue the winform tutorial uses this database.
Does anyone know where I can find a Northwind end to end database solutions (examples) written in ASP.NET (VB). I would like to reverse engineer this project to learn more about ASP.NET?
I am trying to connect to SQL 7.0 northwind database via visual studio2005. But I can't open the connection. I get an error saying remoteaccess is not allowed. But the remote access is ok. I can used the samelogin and connect to the sql server via enterprise manage.SqlConnection conn = new SqlConnection("DataSource=(sqlserver:1433);Initial Catalog=Northwind;UserID=me;Password=mypassword");The above is the string I am trying to use.Is there a way to do this in Visual studio thanks
Hi.I'm very new to this so I apologise in advance for asking the blindibly obvious. I have installed SQL Express and SQL Server Management Studio Express and I have downloaded and attached the Northwind sample database. I can see and edit the data in the tables but when I try to open the Database Diagram node I get the following message:Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.I have no idea what a valid logon would be. Can somebody help? Thanks
i try create this example:http://www.codeproject.com/KB/webforms/ReportViewer.aspxI have Northwind database added in the SQL server management and i select Northwind databse in drop box and I push Execute!ALTER PROCEDURE ShowProductByCategory(@CategoryName nvarchar(15) )ASSELECT Categories.CategoryName, Products.ProductName, Products.UnitPrice, Products.UnitsInStockFROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryIDWHERE CategoryName=@CategoryNameRETURNbut error is:Msg 208, Level 16, State 6, Procedure ShowProductByCategory, Line 11Invalid object name 'ShowProductByCategory'.on web not so clear what is issue pls. help
I am trying to execute the following query , in Management Studio. But it takes forever. Can someone tell me why is this happening? I am running the query in 'NorthWind' database.The windows account under which I am logged into WinXP (windows authentication is enabled for the SQL Server database) is the database owner for NorthWind database. alter database NorthWind SET ENABLE_BROKER
Hi,Good morning to All. While doing practice I did some modifications to some tables in Northwind database.Now, how can I get my original tables back again? Take Oracle for example:We can modify table data. But when we run demobld.sql script then all tables will replaces with original entries. Like this I want in SQL Server also. Is there any such facility available in SQL Server? Thanks in advance,Ashok kumar.
I have been following the Visual Basic Guided Tour for VB 2008 Express and I'm having a problem with the following part.
ms-help://MS.VSCC.v90/MS.msdnexpress.v90.en/dv_vbcnexpress/html/48fcb538-d8c7-4299-a2bf-a5b6f80d879d.htm Creating LINQ to SQL Classes: Using the O/R Designer
I am getting the error "Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances.", when I get to the Test Connection button.
but I have no idea how to use this information as it assumes the user knows what they are doing! The solution appears to involve running a scipt of some sort, but where would that be run? I have looked at the SQL server Express information, but can't find how to run sp_configure. Your help would be much appreciated.
I downloaded the Northwind database install script (SQL2000SampleDb.msi) and ran instnwnd.sql in my SQL Server Management Studio Express. I got the following error messages:
Msg 5105, Level 16, State 2, Line 1
A file activation error occurred. The physical file name 'northwnd.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 15010, Level 16, State 1, Procedure sp_dboption, Line 64
The database 'Northwind' does not exist. Use sp_helpdb to show available databases.
Msg 15010, Level 16, State 1, Procedure sp_dboption, Line 64
The database 'Northwind' does not exist. Use sp_helpdb to show available databases.
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'Northwind'. No entry found with that name. Make sure that the name is entered correctly.
Msg 3726, Level 16, State 1, Line 2
Could not drop object 'dbo.Customers' because it is referenced by a FOREIGN KEY constraint.
Msg 3726, Level 16, State 1, Line 2
Could not drop object 'dbo.Employees' because it is referenced by a FOREIGN KEY constraint.
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'Employees' in the database.
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'LastName' already exists on table 'dbo.Employees'.
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'PostalCode' already exists on table 'dbo.Employees'.
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'Customers' in the database.
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'City' already exists on table 'dbo.Customers'.
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'CompanyName' already exists on table 'dbo.Customers'.
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'PostalCode' already exists on table 'dbo.Customers'.
Msg 1913, Level 16, State 1, Line 1
The operation failed because an index or statistics with name 'Region' already exists on table 'dbo.Customers'.
(1 row(s) affected)
............................................etc.
Please help and advise me how to get the Northwind database installed in my SQL Server Management Studio Express.
I tried to install the Northwind database into SQl Server Express via the instnwnd.sql script using the command line:
osql -E -i instnwnd.sql
after a time out though I get this message:
"[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQL Native Client]Login timeout expired [SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections."
I already granted access to the administrator account on my machine.
I am using Northwind database to Create a view showing every order that was shipped to Spain. Name the destination column 'DestinationSpain'. Include code that checks if the view already exists. If it does, it should be dropped and re-created.
Here is my script:
use Northwind GO
/*STEP 2, #1*/
/* does it exist, if so drop it */ if exist (select * from dbo.sysobjects where id = object_id(N'[dbo].[OrdersToSpain]') and OBJECTPROPERTY(id, N'IsView') = 1) drop view [dbo].[OrdersToSpain] GO
/* Create the View */ create view "OrdersToSpain" AS SELECT Orders.OrderID AS Order_ID, Orders.CustomerID AS Customer_ID, Orders.OrderDate AS Ordered_Date. Orders.ShippedDate AS Shipped_Date, Orders.ShipCountry AS DestinationSpain FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE Orders.ShipCounty LIKE '%SPAIN%' GO
Here are the errors I am getting:
Server: Msg 156, Level 15, State 1, Line 5 Incorrect syntax near the keyword 'select'. Server: Msg 170, Level 15, State 1, Line 6 Line 6: Incorrect syntax near ')'. Server: Msg 170, Level 15, State 1, Procedure OrdersToSpain, Line 7 Line 7: Incorrect syntax near '.'.
I have Visual Studio 2005 Beta 2.00 install which have installed the SQLEXPRESS server. I have the Script for the Northwind database which I need to run some demos but I can figure out how to execute this script. Can someone tell me what todo or how to attatched the database to this server. I also have a copy of the database already created. But When I tried login in into the database I get an error login fail. Which is the default user amd password for the northwind database? Tia Charles
Long time ago, I downloaded the Northwind and pubs databases from the Microsoft website (I do not remember the details of it) and installed these two databases together into the SQL Server Management Studio Express of my PC (Microsoft Windows XP Pro). I tried to learn an example of using "User Instance" (source code was from a book) on the Northwind database located in my SQL Server Management Studio Express. I just find out that my Northwind database has the title only and no tables at all. If I click on the "+" in front of the "Northwind", I got the following error message:
Microsoft SQL Server Management Studio Express
Failed to retrieve data for this request.(Microsoft SqlServer.Express.SmoEnum)
Additional information:
One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from backup. (Microsoft SQL Server, Error: 5173)..
Please help and tell me how I can repair this Northwind database in my SQL Server Management Studio Express.
Scott Chang
P. S.
I deleted the name 'Northwind' in my SQL Server Management Studio Express, executed the "SQL2005DBScriptsInstnwind" program and I got the following error message: Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file name listed could not be created. Checked related errors.
Msg 5170, Level 16, state 1, Line 1
Cannot create file 'c:Program FilesMicrosoft SQL ServerMSSQL.1DATAorthwindorthwind.ldf' because it already exist. Change the file path or the file name, and retry the operation.
Msg 15100, Level 16, State 1, Procedure sp_dboption, Line 64
The database 'Northwind' does not exist. Use sp_helpdb to show available database.
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'Northwind'. No entry found with that name. Make sure that name is entered correctly
I tried to use dbo.tables of Northwind database in SQL Server Express to do SqlCommand to populate a DataTable in DataSet. The SqlCommand failed in the project execution and I found that Northwind database in SQL Server Express is busted and gone (just the name "Northwind" remained in the SQL Server Management Studio Express). How can I prevent it from happening in my "SqlCommand-SqlConnection" project? Please help and advise.
I tried to repair my "Northwind" database by using the SQL2000SampleDb.msi of Northwind and pubs Sample Databases for SQL Server 2000 downloaded from the http://www.microsoft.com/downloads. My "pubs" database is still in my SQL Server Management Studio Express. How can I just repair my "Northwind" database by using the Microsoft SQL2000SampleDb.msi program? Please help and advise this matter too.
In my VB 2005 Express, I created a Windowds Form application "shcDataSet" that used 1 SqlConnection, 1 SqlDataSet and 3 SqlDataAdapters associated with the Northwind Database in my SQL Server Management Studio Express. The SqlConnection had "User Instance" in the following ConnectionString: Data Source=.SQLEXPRESS;AttachDbFilename="C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataorthwnd.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True. The 3 SqlDataAdapters were for the Northwind files "Customers", "Orders" and "Order Details" used in the SQLDataSet "AllOrders" with a AllOrders.xsd file. I ran the "shcDataSet" applicatyion and it worked fine. After the execution of "shcDataSet", I checked the Northwind database in my SQL Server Management Studio Express and clicked on "+" in front of Northwind database-I did not see any file showed up and I got the following error message: Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum) Additional information: one or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup. (Microsoft SQL Server, Error:5173). If I executed the "shcDataSet" application again, I got a new error: SqlException was unhandled - Cannot open user default database. Login failed. Login failed for user 'myPC##myName' ------->daCustomers.Fill(AllOrders11, "Customers"). I have 3 questions to ask: (1) How can I re-install the Northwind database in SQL Server Management Studio Express? (2) When I use the .Fill Method, do I have to tell the SQL Server Management Studio Express to load and/or unload the Northwind files "Customers", "Orders" and "Order Details"? (3) After I executed the "shcDataSet", should I Upload the 3 Northwind files back to the SQL Server Management Studio Express? Please help and advise. Thanks, Scott Chang
Please, can anyone tell me why I am getting the undermentioned error message when I develop my application as an IIS Site in Visual Web Developer 2005 Express ? I have already developed and successfully tested it as a 'FileSystem Web Site' .I am using SQLSErver Express 2005 edition and have which I have installed along with the Northwind database as per the download instructions. My IIS software is version 5.1 which I have checked and it is configured to allow Integrated Windows Authentication. the relevant code is (1) web.config file connection strings <connectionStrings> <add name="NorthwindConnectionString" connectionString="Data Source=.sqlexpress;Initial Catalog=Northwind;Integrated Security=True" providerName="System.Data.SqlClient"/> </connectionStrings>(2) the grid view control and sqldatasource <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" /> <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" /> <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [CategoryID], [CategoryName], [Description] FROM [Categories]"> </asp:SqlDataSource>This is the full error message and details: Server Error in '/sqlservertest' Application.
Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'JERRY-3C9615BAAASPNET'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'JERRY-3C9615BAAASPNET'.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
FROM [Order Details] OD, Orders O, Products P, Categories C
WHERE OD.OrderID = O.OrderID
AND OD.ProductID = P.ProductID
AND P.CategoryID = C.CategoryID
AND C.CategoryName = @CategoryName
AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear
GROUP BY ProductName
ORDER BY ProductName
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From an ADO.NET 2.0 book, I copied the code of ConnectionPoolingForm to my VB 2005 Express. The following is part of the code:
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Diagnostics
Public Class ConnectionPoolingForm
Dim _ProviderFactory As DbProviderFactory = SqlClientFactory.Instance
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
'Force app to be available for SqlClient perf counting
Using cn As New SqlConnection()
End Using
InitializeMinSize()
InitializePerfCounters()
End Sub
Sub InitializeMinSize()
Me.MinimumSize = Me.Size
End Sub
Dim _SelectedConnection As DbConnection = Nothing
Sub lstConnections_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles lstConnections.SelectedIndexChanged
End Sub /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I executed the code successfully and I got a box which asked for "Enter the query string". I typed in the following: EXEC dbo.SalesByCategory @Seafood. I got the following box: Query attempt failed. Must declare the scalar variable "@Seafood". I am learning how to enter the string for the "SQL query programed in the subQuery_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnQuery.Click" (see the code statements listed above). Please help and tell me what I missed and what I should put into the query string to get the information of the "Seafood" category out.