Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cannot create ActiveX component

Posted on 2013-06-17
2
Medium Priority
?
659 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
  • 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

971 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