Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 15th, 2008, 11:15 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default remote sql server 2005 problem

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="navbingo20@gmail.com" />
<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&nbsp;</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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;


    </div>

    <div id="header-photo">
        &nbsp;
        <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>&nbsp; &nbsp; &nbsp;<span
            style="font-size: 14pt"> &nbsp;&nbsp; &nbsp; <span style="color: #ff0033">&nbsp;<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" />&nbsp;</p>
        <p style="text-align: justify">
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
                style="color: #000000">&nbsp; 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>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            <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>
            &nbsp;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>

            &nbsp;

        <p>

            <asp:AccessDataSource
                   ID="callingcardsource" runat="Server" DataFile="~\callingcard.mdb" SelectCommand="SELECT DISTINCT cardname FROM calling ORDER BY cardname">
               </asp:AccessDataSource>
            &nbsp;</p>
               &nbsp;</p>
        <p>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            <asp:LinkButton ID="LinkButton1" runat="server" onclick= "click1" Width="168px">Steps to open Home Account</asp:LinkButton></p>
        <p>
            &nbsp;<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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;
               &nbsp; &nbsp; &nbsp;&nbsp;
               <asp:TextBox ID="Textsearch" runat="server" Visible="False"></asp:TextBox></p>
        <p>
            <asp:TextBox ID="Textsearch2" runat="server" Visible="False"></asp:TextBox>&nbsp;</p>
            <p>
                &nbsp;</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>

                &nbsp;

             <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>&nbsp;<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>
            &copy; 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>

           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

            <a href="index.html">Home</a>&nbsp;|&nbsp;
           <a href="index.html">Sitemap</a>&nbsp;|&nbsp;
           <a href="index.html">RSS Feed</a>
           </p>

        </div>


</div>


</div>
</div>
</body>
</html>


trainee
__________________
trainee
Reply With Quote
  #2 (permalink)  
Old July 15th, 2008, 01:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Check this out: http://support.microsoft.com/kb/914277

Brian
Reply With Quote
  #3 (permalink)  
Old July 16th, 2008, 03:08 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

i have tried evrythng ...but no use...it showing me the same error...
is any problem with my coding ??
shld i contact the third party , sql server provider for any technical assistance...

trainee
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql server 2005 connection problem Mahenj C# 2005 17 April 20th, 2015 12:12 AM
SQL Server 2005 webBrowser problem misterC SQL Server 2005 0 February 3rd, 2006 11:54 AM
SQL Server 2005 Express Problem asped_man BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 November 29th, 2005 05:07 AM
SQL Server 2005 Reporting problem saikrishna_80 SQL Server 2000 1 October 5th, 2005 09:43 AM



All times are GMT -4. The time now is 09:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.