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

  • Home
  • SEARCH
  • 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 7611789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:45:01+00:00 2026-05-31T01:45:01+00:00

I haven’t used .Net since 2005, so I copied the ADO sample code from

  • 0

I haven’t used .Net since 2005, so I copied the ADO sample code from Microsoft (which is shoddy at best), and got a Compilation Error at line 1:

ASPNET: Make sure that the class defined in this code file matches the
‘inherits’ attribute, and that it extends the correct base class (e.g.
Page or UserControl).

Line 1:  using System;
Line 2:  using System.Data;
Line 3:  using System.Data.SqlClient;

I put the sample code in a .aspx.cs file. Was I supposed to declare something before the using …?

  • 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-05-31T01:45:02+00:00Added an answer on May 31, 2026 at 1:45 am

    The problem appears to be that the MSDN code sample you’re using wasn’t prepared for use in a web page. Classes defined in a code behind should inherit from Page or UserControl and the Console application example from MSDN doesn’t do either.

    Perhaps one of the ASP.NET tutorials would provide a better example.

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

Sidebar

Related Questions

Haven't done ASP.NET development since VS 2003, so I'd like to save some time
I haven't used C++ since college. Even though I've wanted to I haven't needed
I haven't made any thorough analysis of which implementation of PHP is the best
I haven't done a lot of .NET programming, but I've examined a few of
I haven't been able to figure out how to use strings from resource files
I haven't used emacs but have heard about its features and really want to
haven't used regex replaces much and am not sure if how I have done
I haven't used the implements keyword before, and I've been trying to use it
I have a text area in my form which accepts all possible characters from
Haven't done serious JavaScript since 90s, so looks like a couple of things changed.

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.