// // Tanya Koneksi Database Sql Server 2005 dari ASP.NET 02 - Geeks Portal

Tanya Koneksi Database Sql Server 2005 dari ASP.NET 02

Last post 08-26-2011 17:14 by rudi.anto. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-18-2011 22:35

    • joneesat
    • Not Ranked
    • Joined on 08-04-2011
    • Posts 1
    • Points 20

    Tanya Koneksi Database Sql Server 2005 dari ASP.NET 02

     Dear Pak Choirul,

    saya newbie yang lagi mau belajar asp.net

    untuk project pertama source code saya dapatkan di http://www.leaveflow.com/linner.aspx?clm=5

    requrement nya :

    Requirements
    ASP.NET 2.0 (or later versions)
    MS SQL 2000 (or later versions. SQL Express versions also work)

    Saya sudah install sesuai tutor yang ada di internet dan bisa masuk di halaman index, tetapi sealu gagal pada waktu konek ke Database nya :

    saya menggunakan ASP.Net 02, Ms SQL Server Express + Manajemen dan Cassiini Web Server 

    saya juga sudah enable : SQL server enabled for remote connections

    Error yang selalu Timbul adalah sbb : 

    Server Error in '/' Application.
    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)
    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: 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)

    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): 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)]
      System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection) +89
      System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj) +207
      System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
    SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout,
    Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
    integratedSecurity, SqlConnection owningObject) +303
      System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
    timerExpire, SqlConnection owningObject) +178
      System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
    host, String newPassword, Boolean redirectedUserInstance,
    SqlConnection owningObject, SqlConnectionString connectionOptions,
    Int64 timerStart) +402
      System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String
    newPassword, Boolean redirectedUserInstance) +234
      System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo,
    String newPassword, SqlConnection owningObject, Boolean
    redirectedUserInstance) +190
      System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool,
    DbConnection owningConnection) +493
      System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    owningConnection, DbConnectionPool pool, DbConnectionOptions options)
    +29
      System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject) +437
      System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject) +70
      System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    owningObject) +449
      System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection) +103
      System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory) +101
      System.Data.SqlClient.SqlConnection.Open() +137
      clsDataFunctions.GetDataReader(String strSql) +129
      clsSecurity.ValidateUser(String strUserName, String strPassword,
    Boolean bolAbandon, String strLoginType) +267
      _Default.cmdLogin_Click(Object sender, ImageClickEventArgs e) +109
      System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +78
      System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String
    eventArgument) +118
      System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +10
      System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +13
      System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
      System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +2863
     

     Berikut db.config nya : 

    <connectionStrings>
       <add name="smartlvConnectionString" connectionString="Data
    Source=localhost;Initial Catalog=leaveman;Persist Security
    Info=True;User=sa;Password=pwd;"
    providerName="System.Data.SqlClient"/>
    </connectionStrings>

     Kira2 apa permasalahan dari script yang saya dapat sehingga saya mendapat error tersebut 

     

    Terima Kasih Sebelumnya Pak 

    Jonii

     

    • Post Points: 20
  • 08-26-2011 17:14 In reply to

    • rudi.anto
    • Top 500 Contributor
    • Joined on 02-13-2007
    • Posts 6
    • Points 205

    Re: Tanya Koneksi Database Sql Server 2005 dari ASP.NET 02

    kalau pakai sqlexpress kayanga salah ga begitu kalau mau gampang di visual studia add database terus di file databasenya klik kanan properties nanti disitu ada conncetion stringnya di copas deh taro web.config.

    • Post Points: 5
Page 1 of 1 (2 items)