Help me Please! - Custom Controls

Discussion in 'ASP .Net Building Controls' started by Adnan Strujic, Oct 6, 2004.

  1. I'm developing paging control. One of the properties of this control is
    SqlConn propertie.

    When i set this property from designer, I receive error that you can see
    bellow. I spent 3 days trying to figure out this problem without any
    success.

    Please help

    This is SqlConn property:
    -----------------------------------------------------
    [Bindable(true),
    Description("Set SQL Connection"),
    Category("Data"),
    DefaultValue(null),
    TypeConverter(typeof(SqlConnection))]
    public virtual SqlConnection SqlConn
    {
    get
    {
    return sqlConn;
    }

    set
    {
    sqlConn = value;
    }
    }

    This is error that I receive when I try to run application that use my
    control:
    --------------------------------------------------------------
    Server Error in '/TestApplication' Application.
    ----------------------------------------------------------------------------
    ----

    Unable to generate code for a value of type
    'System.Data.SqlClient.SqlConnection'. This error occurred while trying to
    generate the property value for SqlConn.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Unable to generate code for a
    value of type 'System.Data.SqlClient.SqlConnection'. This error occurred
    while trying to generate the property value for SqlConn.

    Source Error:


    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.


    Stack Trace:


    [HttpException (0x80004005): Unable to generate code for a value of type
    'System.Data.SqlClient.SqlConnection'. This error occurred while trying to
    generate the property value for SqlConn.]

    System.Web.Compilation.CodeDomUtility.GenerateExpressionForValue(PropertyInf
    o propertyInfo, Object value, Type valueType)

    System.Web.Compilation.TemplateControlCompiler.BuildBuildMethod(ControlBuild
    er builder, Boolean fTemplate, PropertySetterEntry pse)

    System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilde
    r(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse)

    System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilde
    r(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse)

    System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilde
    r(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse)
    System.Web.Compilation.TemplateControlCompiler.BuildMiscClassMembers()
    System.Web.Compilation.PageCompiler.BuildMiscClassMembers()
    System.Web.Compilation.BaseCompiler.BuildSourceDataTree()
    System.Web.Compilation.BaseCompiler.GetCompiledType()
    System.Web.Compilation.PageCompiler.CompilePageType(PageParser
    pageParser)
    System.Web.UI.PageParser.CompileIntoType()
    System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()

    [HttpException (0x80004005): Unable to generate code for a value of type
    'System.Data.SqlClient.SqlConnection'. This error occurred while trying to
    generate the property value for SqlConn.]
    System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean
    fCreateIfNotFound)
    System.Web.UI.TemplateParser.GetParserCacheItem()
    System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
    virtualPath, String inputFile, HttpContext context)
    System.Web.UI.TemplateControlParser.GetCompiledInstance(String
    virtualPath, String inputFile, HttpContext context)
    System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String
    virtualPath, String inputFile, HttpContext context)
    System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String
    requestType, String url, String path)
    System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
    requestType, String path, String pathTranslated, Boolean useAppConfig)

    System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep
    ..Execute()
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously)





    ----------------------------------------------------------------------------
    ----

    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
    Version:1.1.4322.2032
    Adnan Strujic, Oct 6, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    484
    Chris Uppal
    May 5, 2005
  2. KK
    Replies:
    2
    Views:
    498
    Big Brian
    Oct 14, 2003
  3. MuZZy
    Replies:
    7
    Views:
    1,710
    Mike Hewson
    Jan 7, 2005
  4. user
    Replies:
    1
    Views:
    416
    Kevin Spencer
    Jul 19, 2007
  5. rodchar
    Replies:
    0
    Views:
    375
    rodchar
    Nov 26, 2007
Loading...

Share This Page