Solved

Cannot create ActiveX component

Posted on 2013-06-17
2
645 Views
Last Modified: 2013-06-24
I am getting following error:
EL4 :err:374:BuildSQLCmd:Uncomment-full Error:System.Exception: Cannot create ActiveX component.
at Microsoft.VisualBasic.Interaction.GetObject(String PathName, String Class)
at Company.get_CompanyID() in c:\Projects\sqlCamSmoAdoCSplusDev\sqlCamSmoAdoCSplusData\Secure\Company.aspx.cs:line 401
at Company.BuildSQLCmd(String StoredProcName, SqlConnection Conn, SqlTransaction tr, Boolean AutoParams)
in c:\Projects\sqlCamSmoAdoCSplusDev\sqlCamSmoAdoCSplusData\Secure\Company.aspx.cs:line 346

return (string)Microsoft.VisualBasic.Interaction.GetObject("CompanyID", null);// line 401 error
if (cmd.Parameters.Contains("@CompanyID") & CompanyID != null)// line 346 error

Thanks in advance for any help given.
Complete code as per attached file.
Below is complete display on screen:
EL1 :err:103:PL:AppConnection:Server=.\SQLEXPRESS;Database=Cams2;Uid=sa;#
EL1 :err:108:PL:AppConnection:Server=.\SQLEXPRESS;Database=Cams2;Uid=sa;#StartCo:StartURL:UserID:4#
EL1 :err:270:GDT:AppConnection:Server=.\SQLEXPRESS;Database=Cams2;Uid=sa;# SQLProc:usp_GetUserAccess ParmName:@UserID ParmValue:4#
EL1 :err:302:BuildSQLCmd:AppConnection:Server=.\SQLEXPRESS;Database=Cams2;Uid=sa;#StoredProcName:usp_GetUserAccess
EL1 :err:330:cmd !nothing:AppConnection:Server=.\SQLEXPRESS;Database=Cams2;Uid=sa;#

EL4 :err:374:BuildSQLCmd:Uncomment-full Error:System.Exception: Cannot create ActiveX component. 
at Microsoft.VisualBasic.Interaction.GetObject(String PathName, String Class) 
at Company.get_CompanyID() in c:\Projects\sqlCamSmoAdoCSplusDev\sqlCamSmoAdoCSplusData\Secure\Company.aspx.cs:line 401 
at Company.BuildSQLCmd(String StoredProcName, SqlConnection Conn, SqlTransaction tr, Boolean AutoParams) 
in c:\Projects\sqlCamSmoAdoCSplusDev\sqlCamSmoAdoCSplusData\Secure\Company.aspx.cs:line 346

return (string)Microsoft.VisualBasic.Interaction.GetObject("CompanyID", null);// line 401 error
if (cmd.Parameters.Contains("@CompanyID") & CompanyID != null)// line 346 error

EL3 :err:293:catch:Uncomment-full Error:System.NullReferenceException: 
Object reference not set to an instance of an object. 
at Company.GetDataTable(SqlConnection Conn, String SQLProc, String ParmName, String ParmValue) 
in c:\Projects\sqlCamSmoAdoCSplusDev\sqlCamSmoAdoCSplusData\Secure\Company.aspx.cs:line 275
EL4 :err:157:PL:Uncomment-full Error:System.NullReferenceException: 
Object reference not set to an instance of an object. at Company.Page_Load(Object sender, EventArgs e) 
in c:\Projects\sqlCamSmoAdoCSplusDev\sqlCamSmoAdoCSplusData\Secure\Company.aspx.cs:line 113

Open in new window

AttachedFileCS.txt
0
Comment
Question by:homeshopper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 

Accepted Solution

by:
homeshopper earned 0 total points
ID: 39253628
Managed to crack it, the error in the code. Solution below:
original code:
protected string CompanyID
    {
        get
        {
            return GetObject("CompanyID"); // this line gives error
         }
        set
        {
            SaveObject("CompanyID", value);
        }
    }

Open in new window

 
protected string CompanyID
    {
        get
        {
       return (string)Microsoft.VisualBasic.Interaction.GetObject("CompanyID", null);// this line gives error   
}
        set
        {
            SaveObject("CompanyID", value);
        }
    }

Open in new window

Solution below:
protected string CompanyID
    {
        get
        {
          return (string)GetObject("CompanyID");
        }
        set
        {
            SaveObject("CompanyID", value);
        }
    }

Open in new window

0
 

Author Closing Comment

by:homeshopper
ID: 39270820
Managed to crack it, the error in the code. See Solution:
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question