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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:48:35+00:00 2026-05-28T00:48:35+00:00

I have two problems: I am creating a WebControl and I like to add

  • 0

I have two problems:

I am creating a WebControl and I like to add SqlDataSource as its property. It doesn’t matter under what is the property name, Visual Studio shows its name as Database. Following is my code and Visual Studio 2010 express shows all Data1~Data3 properties in Property Editor as “Database”

Second problem is when I click on arrow beside the Databse name in Property Editor I get an exception “The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))”

Which part I’m doing wrong?

My component code:

using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

namespace Comp1 {
    [ToolboxData("<{0}:M1GridData runat=server></{0}:M1GridData>")]
    public class M1GridData : WebControl {

        public SqlDataSource Data1 { get; set; }
        public SqlDataSource Data2 { get; set; }
        public SqlDataSource Data3 { get; set; }

        protected override void Render(HtmlTextWriter writer) {
                writer.Write("Something");
        }
    }
}

My page code:

<cc1:M1GridData ID="M1GridData1" runat="server" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" />
  • 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-28T00:48:36+00:00Added an answer on May 28, 2026 at 12:48 am

    I tried your code and it works fine. may be you need to restart your visual studio or reinstall the component.

    also check Temporary ASP.NET Files folder in each of frameworks you installed in C:\WINDOWS\Microsoft.NET\Framework\ and delete its content. sometimes ASP.NET forgets to delete a cached dll and you get lots of non-sence errors because of that.

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

Sidebar

Related Questions

I have my program that can draw rectangles. I have two problems I can't
I have two cmake-related problems: first, I can't make it to find the includes
I have some localization problems in my webpage. There are basically two problems (that
We are having some problems deploying our WCF services into IIS7. We have two
I'm having some problems trying to perform a query. I have two tables, one
I have problems creating a custom query. This is what entities: @Entity public class
I have been having problems creating a relative layout in XML for a list
I'm creating an object that will have two integers (or NSNumber s) and an
I am creating an app, in which I have two small imageview (using have
Hi I am having problems with some css classes in joomla. I have two

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.