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 7777077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:02:46+00:00 2026-06-01T18:02:46+00:00

I am setting up a custom tab where users can view and edit data.

  • 0

I am setting up a custom tab where users can view and edit data. I need to establish a trusted SQL connection and have the data displayed in a grid view.

Should I build a console or web app?

I have provided my .aspx and aspx.cs files below.

I get the error message below while running it:

“Error: 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)”.

Here is my Default.aspx code:

<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <headrunat="server">
        <title></title>
    </head>
    <body>
        <formid="form1"runat="server">
        </form>
    </body>
</html>

Here is my Default.aspx.cs code:

///<summary>
///Demonstrates how to work with SqlConnection objects
///</summary>
class SqlConnectionDemo
{
    static void Main()
    {
        // 1. Instantiate the connection
        SqlConnectionconn = newSqlConnection("Data Source=TestDB;Initial Catalog=Impresario;Integrated Security=SSPI");
        SqlDataReaderrdr = null;
        try
        {
            // 2. Open the connection
            conn.Open();
            // 3. Pass the connection to a command object
            SqlCommandcmd = newSqlCommand("select * from LT_WEB_DONATIONS_EXTRA_INFO_TEMP", conn);

            //
            // 4. Use the connection
            //
            // get query results
            rdr = cmd.ExecuteReader();

            // print the CustomerID of each record
            while (rdr.Read())
            {
            Console.WriteLine(rdr[0]);
            }
        }
        finally
        {
            // close the reader
            if(rdr != null)
            {
                rdr.Close();
            }

            // 5. Close the connection
            if(conn != null)
            {
                conn.Close();
            }
        }
    }
}
  • 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-01T18:02:47+00:00Added an answer on June 1, 2026 at 6:02 pm

    Your code-behind page must inherit from System.Web.UI.Page, like so:

    public partial class _Default : System.Web.UI.Page
    {
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application where I need to have a custom setting page. In
I would like to read custom setting which i have done in ServiceConfiguration.cscfg &
I have a application for android 2.3.3 where I am setting some custom titles
I have a custom drop down box I have made and focus can be
I have a custom tab control, which displays a frame inside the TabItem, and
I have a grid view which is populated using a custom ImageAdapter class extending
i am setting custom title in my tab activity like this boolean customTitleSupported; customTitleSupported
I'm writing a custom UITabBarController so I can fully control appearance of the tab
It appears as though NSNumberFormatter's method for setting custom formatters . setFormat: isn't available
I'm setting a custom StatusDescription in a RESTful WCF service when an exception is

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.