hi ,
i have created a website using visual studio 2005 , asp.net 2.0 , access database .. it works well within the local host..
now i have moved all my files to my hosting site and i am using sql server 2005 from the third party ...i am retriving only two data from this sql server...
when i execute the program from my hosting provider ..it showing me error message..can u help me out to solve this issue plz....
error message :
--------------------------------------------------------------------------------
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +800131
web config file:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings />
<connectionStrings>
<remove name="LocalSqlServer" />
<clear/>
<add name="LocalSqlServer" connectionString="Data Source=10.40.110.100;Initial Catalog=Jupitel2France;Integrated Security=True; uid=*** ; pwd=***" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<authorization>
<allow users="navin" />
</authorization>
<roleManager enabled="true" />
<authentication mode="Forms" />
<pages enableEventValidation="false" />
<compilation debug="true" />
<profile>
<properties>
<add name="loginname1" defaultValue="" />
</properties>
</profile>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<machineKey validationKey="4BFB8F1F6611EA4E4621888B5828003FF5E C98916ABEB3163BD0F29A5B19DD1BF9BACF4CD7F37F0A07378 A651DDC77F5AA3BC731E652AE355D02631064803845"
decryptionKey="5951A42B1F6420EDDB8828738FDD8305D94 559728BBBF48A" validation="SHA1" />
</system.web>
</configuration>
program file:
<%@ Page Language="
VB" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Xml" %>
<%@ import Namespace="System.Xml.Xsl" %>
<%@ import Namespace="system.data.sqlclient" %>
<%@ import Namespace="system.data.oledb" %>
<script runat="server">
' Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim myDataReader As System.Data.SqlClient.SqlDataReader
'Dim myConnection As System.Data.SqlClient.SqlConnection
'Dim myCommand As System.Data.SqlClient.SqlCommand
'Dim strSQL As String
'myConnection = New SqlConnection("server=10.40.110.100; uid=***; pwd=***; database=Jupitel2France;")
'myConnection.Open()
'strSQL = "SELECT account FROM users"
'myCommand = New SqlCommand(strSQL, myConnection)
'myDataReader = myCommand.ExecuteReader()
'TextBox1.Text = myDataReader.Item("genretype")
'textbalance.Text = myDataReader.GetString(0)
'myDataReader.Close()
'myConnection.Close()
'myConnection.Dispose()
'End Sub
Sub Get_Criterion(ByVal Src As Object, ByVal Args As EventArgs)
If SearchCriterion.Text <> "" Then
Response.Redirect("Serach.aspx?Criterion=" & SearchCriterion.Text)
End If
End Sub
Sub click1(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("steps.aspx")
End Sub
Sub click3(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("useacct.aspx")
End Sub
Sub click2(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("acctdetails.aspx")
End Sub
Sub click4(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("modifyacct.aspx")
End Sub
Sub click6(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("delacct.aspx")
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="Description" content="Information architecture, Web Design, Web Standards." />
<meta name="Keywords" content="your, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="
[email protected]" />
<meta name="Robots" content="index,follow" />
<link rel="stylesheet" href="images720/Outdoor.css" type="text/css" />
<title>HOME accounts PAGE </title>
</head>
<body>
<form id="Form1" runat="server">
<div id="main_wrap">
<div id="wrap">
<div id="header">
<h1 id="logo-text"><a href="index.html" title="" style="left: 132px; top: 16px">WELCOME TO TELE DIRECT </a></h1>
<p id="slogan" style="left: 24px; top: 76px">
Cheapest Prepaid calling card and and home accounts ...</p>
<div id="header-links" style="right: -6px; top: 71px; width: 295px;">
<p>
<a href="index.aspx">Home</a> |
<a href="contact.aspx">Contact</a> |
<a href="aboutus.aspx">ABOUT US</a> |
<a href="sitemap.aspx">Site Map</a>
</p>
</div>
</div>
<div id="header-photo">
<img src="images720/header-photo.jpg" alt="header-photo" style="width: 420px; height: 205px" />
<img src="img11.jpg" style="width: 436px; height: 203px" /></div>
<div id="nav" style="width: 917px">
<ul style="width: 883px">
<li id="current"><a href="homeacc.aspx" style="width: 136px">Home Accounts</a></li>
<li><a href="pcc.aspx" style="width: 189px">prepaid calling card</a></li>
<li><a href="login.aspx">LOGIN FORM</a></li>
<li><a href="registration.aspx" style="width: 163px">REGISTRATION Form </a></li>
<li><a href="faq.aspx" style="width: 66px">FAQ</a></li>
</ul>
</div>
<div id="content-wrap">
<div id="main">
<a name="TemplateInfo"></a>
<h3>
<span style="font-size: 16pt; font-family: Monotype Corsiva"><strong> <span
style="font-size: 14pt"> <span style="color: #ff0033"> <span
style="font-size: 16pt">WELCOME TO HOME ACCOUNTS</span></span></span></strong></span></h3>
<p>
<img src="introoffer.jpg" style="width: 490px; height: 218px" /> </p>
<p style="text-align: justify">
<span
style="color: #000000"> HOME ACCOUNTS</span></p>
<p>
Using the account s are</p>
<p>
Current Balance:</p>
<p>
ur account number :<asp:TextBox ID="accounttext" runat="server"></asp:TextBox></p>
<p>
ur phone number :
<asp:TextBox ID="phonetext" runat="server"></asp:TextBox></p>
<p>
<asp:Button ID="balance" runat="server" Text="Submit" Width="136px" /></p>
<p>
<asp:Label ID="labelbalance" runat="server" Text="Ur balance is :" Width="104px"></asp:Label>
<asp:TextBox ID="textbalance" runat="server" Width="152px"></asp:TextBox></p>
<p>
Alternatively :</p>
<p>
In order to check your balance all you have to do is press the * key twice
on your phone pad when the computer asks you to dial the destination number.
</p>
<p>
You will hear the message "Please enter the number you wish to dial, credit remaining
......."
</p>
<p>
To check the balance at the end of the call, press # key to first to disconnect
the call and then press * key twice to get your balance.
</p>
<p>
<asp:AccessDataSource
ID="callingcardsource" runat="Server" DataFile="~\callingcard.mdb" SelectCommand="SELECT DISTINCT cardname FROM calling ORDER BY cardname">
</asp:AccessDataSource>
</p>
</p>
<p>
<asp:LinkButton ID="LinkButton1" runat="server" onclick= "click1" Width="168px">Steps to open Home Account</asp:LinkButton></p>
<p>
<asp:LinkButton ID="LinkButton2" runat="server" OnClick="click2" Width="96px">Account Details</asp:LinkButton>
<asp:LinkButton
ID="LinkButton3" runat="server" OnClick="click3" Width="160px">How to Use Home accounts</asp:LinkButton>
<asp:LinkButton
ID="LinkButton4" runat="server" OnClick= "click4" Width="136px">Modify Account details</asp:LinkButton>
<asp:LinkButton
ID="LinkButton6" runat="server" OnClick= "click6" Width="120px">Deleting a Account</asp:LinkButton></p>
<p>
<asp:TextBox ID="Textsearch" runat="server" Visible="False"></asp:TextBox></p>
<p>
<asp:TextBox ID="Textsearch2" runat="server" Visible="False"></asp:TextBox> </p>
<p>
</p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=10.40.110.100;Initial Catalog=Jupitel2France;User ID=***;Password=***"
SelectCommand="SELECT [account] FROM [users]">
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Width="426px">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" CancelText="Cancel" DeleteText="Delete" EditText="Edit" UpdateText="Update"/>
<asp:BoundField DataField="account" HeaderText="account" InsertVisible="False"
ReadOnly="True" SortExpression="account" />
</Columns>
</asp:GridView>
</div>
<div id="sidebar" style="height: 511px">
<h3></h3>
<asp:Label ID="Label2" runat="Server" BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFFF" Style="padding-right: 2px; padding-left: 2px; padding-bottom: 2px;
padding-top: 2px" Text="Searchbox" Width="130px"></asp:Label>
<p>
<asp:TextBox ID="SearchCriterion"
runat="Server" Font-Size="8pt" Height="19px" Width="98px"></asp:TextBox>
<asp:Button
ID="Button1" runat="Server" Font-Size="8pt" Height="23px" OnClick="Get_Criterion"
Text="Search" Width="115px" /></p>
</form>
<br/>
<br/>
<h3> MENU</h3>
<ul class="sidemenu">
<li><a href="homeacc.aspx">INTRODUCTION TO HOME ACCOUNTS</a></li>
<li><a href="acc.aspx"> HOME ACCOUNT</a></li>
<li><a href="topup.aspx">TOP-UP</a></li>
<li><a href="vaf.aspx">VALUE ADDED FEATURES</a></li>
<li><a href="price.aspx">PRICE PLAN</a></li>
<li><a href="service.aspx">SERVICE LINKS</a></li>
</ul>
<h3>USEFUL LINKS</h3>
<ul class="sidemenu">
<li><a href="delivery.aspx">DELIVERY</a></li>
<li><a href="payment.aspx">PAYMENT</a></li>
<li><a href="http://www.xe.com">MONEY CONVERTOR</a> <br />
<br />
<img src="customerservicenumber%20copy.jpg" style="width: 255px; height: 136px" />
<br />
</li>
</div>
</div>
<div id="footer-wrap">
<div id="footer-bottom">
<p>
© 2008 <strong>JUPITEL TELECOM</strong> |
Design by: JUPITEL |
Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a> |
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
<a href="index.html">Home</a> |
<a href="index.html">Sitemap</a> |
<a href="index.html">RSS Feed</a>
</p>
</div>
</div>
</div>
</div>
</body>
</html>
trainee