Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7951301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:31:12+00:00 2026-06-04T02:31:12+00:00

I have a WinForm which connects to a OleDb. Whilst the Project (In Visual

  • 0

I have a WinForm which connects to a OleDb. Whilst the Project (In Visual Studio 2010) was open i clicked on the New Menu and Said Add New Web Site now the problem is i have a class which i created before adding the website – but the code-behind file can’t pick up that namespace or class example: (Note both projects are in the same solution)

namespace Name
{
    //Code From The Original Project before Adding The WebSite
    class DataAccessObject
    {
        private ...;
        private ...;
    }
}

  public partial class Candidate : System.Web.UI.Page
  {
     ...
     ...
     ...
     DataAccessObject dao = new DataAccessObject();
  }

The WebSite Section of the Project Does not even Pick up the NameSpace –

I have Also Tried

  public partial class Candidate : System.Web.UI.Page
  {
     ...
     ...
     ...
     Name.DataAccessObject dao = new DataAccessObject();
  }

EDIT

Also The whole idea behind this is that the user can switch between winForms and Web at will, So to pass on the DataAccessObject is required.

NOTE THIS IS THE VERY FIRST TIME I AM ENTERING THE WORLD OF ASP(.NET)

Any Advice

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:31:14+00:00Added an answer on June 4, 2026 at 2:31 am

    I assume the class is in the WinForms project. As far as I know, you can’t add a reference to a WinForms application from an ASP.NET website. (I could be wrong on that, though.)

    The usual pattern for having classes that are shared between projects is to have the classes in a separate Class Library project. Then, from the WinForms app and the ASP.NET website, you can add a reference, either to the project (if the project is in the same Solution) or the compiled .dll that the Class Library project generates.

    Be sure the class is declared as Public, and you need to add the reference in Visual Studio.

    Technically, you could get away with creating a .dll from the Class Library project and simply copying it into the \bin directory of the website, but from experience, it’s better to have them in the same solution and add the project reference. This guarantees that the website always has the most recent version of the .dll.

    There’s a walk-though here and another related, helpful article here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winform project which lists all the files in a specified folder.
I have a windows installer project which installs some software (winform, service, mce addin).
I have a console application which can also open winform under certain conditions.Processing(its a
My Main Project Is Under WPF, In My Solution I have: winform which name
Hi Guys I have a winform which acts as an interface for a database.
I have a Winform app which lists a batch of invoices in a gridview.
I have a winform form which has typical OK and Cancel buttons. The OK
I have a winform application which contains a window resizable but one requirement is
I have a problem with winform application which uses threads to update the UI.
I have own component which works in my testing winform app good but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.