Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET ActiveX
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:
 
<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:
 
 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 26-Mar-13 0:58am
Medo-I641
Edited 26-Mar-13 7:49am
v4
Comments
aspnet_regiis -i at 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 at 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.
aspnet_regiis -i at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]).
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100