Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 556
  • Last Modified:

Import namespace problem

I've got the following market.cs file(short version)

******************************************
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

namespace Market
{
   public class InventoryDB
   {
      public DataTable GetProducts(int categoryID) {

          SqlConnection sqlConnection = new SqlConnection("server=(local)\\NetSDK;database=grocertogo;Trusted_Connection=yes");
          SqlDataAdapter sqlAdapter1 = new SqlDataAdapter("Select * from Products where categoryid=" + categoryID, sqlConnection);

          DataSet products = new DataSet();
          sqlAdapter1.Fill(products, "products");

          return products.Tables[0];
      }
  }
}

*************************************

In my aspx file I import the follwing

**************************************
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Market" %>


<html>
<head>
****************************************

I am, getiing an error on the import namespace market. Does anybody know why this happens?
0
waaromikniet
Asked:
waaromikniet
  • 2
1 Solution
 
mmarinovCommented:
hav you add a reference to this namespace ?
0
 
waaromiknietAuthor Commented:
How do you mean?

I downloaded a sample from the quicktutorials website. I thought they would work. i am just beginning in .Net can you define what you mean with reference
0
 
mmarinovCommented:
you have to rebuild the application so you will need market.dll ( which will be imported )
if you use vs - go to your project and add a reference by selecting Market

B..M
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now