Solved

Cannot create ActiveX component

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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