Solved

Cannot create ActiveX component

Posted on 2013-06-17
2
621 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now