Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32060

Error when passing connection string to activeX

$
0
0
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:
 

<scriptlanguage="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()">

<formid="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]);


            }
        }
 
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)

Viewing all articles
Browse latest Browse all 32060

Trending Articles