Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello all

I am using ActiveX in my web application in one page, it is working properly in my PC, i am passing the connection string from the web page that has the activex in it as following:

This is the javascript code in the page that passing the connection string to the activex:

ASP.NET
<script language="javascript" type="text/javascript">
      function Connect() {
          var doc = document.forms[0];

          var PrinterControl = document.applets('PrinterObject1');
          PrinterControl.UserText = document.form1.hdnConString.value + ',' + document.form1.hdnCategory.value + ',' + document.form1.hdnLoginID.value + ',' + document.form1.hdnPassword.value + ',' + document.form1.hdnCategoryType.value;

      }          
      </script>

<body  önload="Connect()">
    <form id="form1"  runat="server" >
.
.
.
.
</form>
</body>


and in the activeX code i receive the connection string and other values as following:

C#
public String UserText
       {
           get
           {
               return conString;
           }
           set
           {
                conString = value;

                string[] arrID = conString.Split(',');
                conStr = Convert.ToString(arrID[0]);
                category = Convert.ToString(arrID[1]);
                loginID = Convert.ToString(arrID[2]);
                password = Convert.ToString(arrID[3]);
                categoryType = Convert.ToString(arrID[4]);
           }
       }


Every thing working properly in my pc, but when i install this application in customer's server, the page that using activex generating error although it is working in my pc and i tested it in other pcs in my company over network still working ok, the customer using Windows2008 with sql server 2012.

The following is the error message generating in the page that using activex, when the page trying to load activex:


A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 = could not open a connection to SQL Server)


Please help

Thank you
Posted
Updated 26-Mar-13 6:49am
v4
Comments
bbirajdar 26-Mar-13 13:12pm    
You are passing the connection string to client side???? Do you want the user to read the connection string and hack the database and purchase everyting for free from your website?
Medo-I 26-Mar-13 14:14pm    
yes iam passing the connection string to the client side, into the activex code, how the user will see the connection string although it is passing inside the code, unfortunately i don't have background in security especially against hackers, anyway this application using inside intranet and not for internet use, also the activex code converted to setup file and installed in every client pc to run the web page that contains the activex.

i think i really need to read a lot in this subject, thanks a lot.
bbirajdar 27-Mar-13 2:19am    
Just right click on the page and select view source . You can see the connection string in the javascript
Medo-I 27-Mar-13 4:03am    
this is really good advice, i tried it in my client side and i saw my connection string, i thing i have to encrypt the connection string.

Thank you

1 solution

As the error message suggests, the problem is probably not related to your code: it is a SQL Sever configuration issue (and Google is your friend[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900