PDA

View Full Version : سوال: مشکل ثبت داده در دیتابیس



hamede-n
سه شنبه 29 آذر 1390, 18:52 عصر
سلام
من یک وب سایت با asp.net 4 , C#‎ ساخته ام هنگام فشردن دکمه ثبت اطلاعات که باید اطلاعات کاربر ثبت بشود error زیر مشاهده می شود:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +5050218
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning() +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.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +270
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5063943
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +524
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +479
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
WebApplication3.order.Button1_Click(Object sender, EventArgs e) in C:\Users\VAIO\Documents\Visual Studio 2010\Projects\WebApplication3\WebApplication3\orde r.aspx.cs:31
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
لطفاً راهنماییم کنید.:ناراحت:

hamid_shrk
سه شنبه 29 آذر 1390, 19:11 عصر
فکر میکنم مشکل از connection string تون باشه

hamede-n
سه شنبه 29 آذر 1390, 19:54 عصر
اما تنظیمات connection string در web.config رو هم درست کردم بازم این ارور رفع نشد!!:ناراحت:

smm2006sh
سه شنبه 29 آذر 1390, 19:55 عصر
سلام
100% مشکل از ارتباط با بانک و اتصال اون هست

error occurred while establishing a connection to SQL Server
وب کانفیگت رو هم چک کن

موفق باشید
یا علی

hamede-n
سه شنبه 29 آذر 1390, 20:31 عصر
وب کانفیگ رو هم چک کردم تمام connection string ها رو هم همینطور . تمام داده ها از دیتا بیس خونده می شن و مشکلی وجود نداره .اما تو این صفحه که می خواد داده ها رو ثبت کنه مشکل داره آدرس www.deltarayancell.com/order.aspx ارور فقط هنگامی نشون داده می شه که دکمه ی پرداخت وجه رو فشار بدین ؟؟؟

Rohollaes
سه شنبه 29 آذر 1390, 20:46 عصر
سلام دوست عزیز ، مشکل شما دقیقا در کانکشن استرینگ هستش . بازم فایل وب کانفیگتو چک کن.

fakhravari
چهارشنبه 30 آذر 1390, 02:26 صبح
بهترین کار گذاشتن وب کنفیگ و بس:بوس: