pozitiveh Yeni Üye
Kayıt Tarihi: 17-Mayıs-2013 Ülke: Türkiye Gönderilenler: 2
|
Gönderen: 17-Mayıs-2013 Saat 05:11 | Kayıtlı IP
|
|
|
Selamlar
Asp.net ile hazırladığım sitede basit bir iletişim tablosuna veri göndermek için site yayındayken butona basınca aşağıdaki hatayı alıyorum. Site local üzerinden çalışırken uzaktaki veritabanına sorunsuzca veri gönderebiliyorum.
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(SqlExcep tion exception, Boolean breakConnection) +5064458 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLog in(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailov er(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnli st(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConne ctionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232 System.Data.SqlClient.SqlConnectionFactory.CreateConnection( DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledCon nection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbCon nection owningObject) +524 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest( DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbCo nnection owningObject) +479 System.Data.ProviderBase.DbConnectionFactory.GetConnection(D bConnection owningConnection) +108 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(D bConnection outerConnection, DbConnectionFactory connectionFactory) +126 System.Data.SqlClient.SqlConnection.Open() +125 System.Data.EntityClient.EntityConnection.OpenStoreConnectio nIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +52
[EntityException: The underlying provider failed on Open.] System.Data.EntityClient.EntityConnection.OpenStoreConnectio nIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +161 System.Data.EntityClient.EntityConnection.Open() +98 System.Data.Objects.ObjectContext.EnsureConnection() +81 System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) +489 System.Data.Entity.Internal.InternalContext.SaveChanges() +120 System.Data.Entity.Internal.LazyInternalContext.SaveChanges( ) +33 System.Data.Entity.DbContext.SaveChanges() +20 Proje.Iletisim.btnKaydet_Click(Object sender, EventArgs e) in c:\Users\admin\Documents\Visual Studio 2012\Projects\Proje\Proje\Iletisim.aspx.cs:26 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEven tHandler.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) +5563
kodlarım ve connectionstring şu şekilde:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;
namespace Proje { public partial class Iletisim : System.Web.UI.Page { varlikset nesne = new varlikset(); protected void Page_Load(object sender, EventArgs e) {
}
protected void btnKaydet_Click(object sender, EventArgs e) { iletisim ilt = new iletisim(); ilt.adsoyad = txtadsoyad.Text; ilt.eposta = txteposta.Text; ilt.konu = txtkonu.Text; ilt.mesaj = txtmesaj.Text; &nbs p; nesne.iletisim.Add(ilt); nesne.SaveChanges();
Response.Redirect("~/Iletisim.aspx"); } } }
<add name="varlikset" connectionString="metadata=res://*/Model1.csdl|res://*/Model 1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;pro vider connection string="data source=hostadres;initial catalog=veritabanıismi;user id=kullanıcı;password=password;MultipleActiveResultSets=True ;App=EntityFramework"" providerName="System.Data.EntityClient" />
iletisim isimli bir tablo id adsoyad eposta konu ve mesaj alanlar.
Yaptığım ilk site olması sebebiyle biraz acemiyim bu hatayı aldım işin içinden çıkamadım yardımcı olursanız sevinirim. Yukarıda hata ekranında bir satırda kendi bilgisayarımla ilgili bir adres var burada sanırım bir ayar yapmam lazım host a attıgım için.
|