PDA

View Full Version : یه مشکل بعد از آپلود خیلی ضروری



ebrahimhoze
سه شنبه 23 بهمن 1386, 20:09 عصر
یه صفحه طراحی کردم وقتی توی ویژوال استادیو اجرا میکنم خوب و بدون مشکل اجرا میشه ولی بعد از آپلود در سرور پیغام خطاء مربوط به کانکشن استرینگ بانک sql میدهد
اینم پیغام

Server Error in '/' Application.

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

Source Error:

Line 146: Dim obj As New SqlDataAdapter("select * from matlab where id='" & i & "'" & "Order By edame Desc", Coon)Line 147: Dim d As New DataSetLine 148: Coon.Open()Line 149: obj.Fill(d, "matlab")Line 150: Me.GridView1.DataSource = d.Tables("matlab")
Source File: D:\Vhosts\visual-code-iran.net\httpdocs\Default.aspx.vb Line: 148

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +739123 System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +685966 System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +109 System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383 System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 _Default.loaddata() in D:\Vhosts\visual-code-iran.net\httpdocs\Default.aspx.vb:148 _Default.Page_Load(Object sender, EventArgs e) in D:\Vhosts\visual-code-iran.net\httpdocs\Default.aspx.vb:12 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

اینم کانکشن استرینگ
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Db.mdf;Integrated Security=True;User Instance=True

اینم سایت من
http://www.visual-code-iran.net

raravaice
سه شنبه 23 بهمن 1386, 20:22 عصر
ebrahimhoze (http://barnamenevis.org/forum/member.php?u=43979) عزیز

تا اونجایی که من مطلع هستم اکثر هاست ها "لااقل شرکت های ایرانی "این روش رو ساپورت نمیکنن بهتره که شما به sql server توی host وصل بشی و بانکت رو اونجا export کنی.

موفق باشی

ebrahimhoze
سه شنبه 23 بهمن 1386, 20:29 عصر
من زیاد از این مسائل سر در نمیآرم
لطفا اگه زحمت بکشید یه توضیح کامل بدید که منم متوجه بشم
خیلی ازتون ممنونم

raravaice
سه شنبه 23 بهمن 1386, 20:35 عصر
یعنی به صورت remote به sql server مقصد وصل بشید و بانک خودتونو آپلود کنید.

توی تالار sqlserver سئوال رو مطرح کنید یا جستجو کنید حتما به جواب می رسید.مطمئن باشید.


موفق باشید

eworkpro
سه شنبه 23 بهمن 1386, 21:33 عصر
تنظیمات مربوط به وب کانفیگ در مورد دیتابیس مثل ip address بانک رو درست انجام دادی ؟

eworkpro
سه شنبه 23 بهمن 1386, 21:45 عصر
البته دوست عزیز یک چیز دیگه هم ممکنه و اون اینکه اگه از تنظیمات دیتابیس و قرار گرفتن درست اون روی sql server هاست مطمئن هستی باید دقت داشته باشه که هنگامی که دیتابیس رو می ریزی روی هاست اطلاعات دیتابیس وارد نمی شه و بنابراین هیچ رکوردی نیست . حالا اگه تو کدهای دیتابیست شرط نگذاشته باشه که ممکنه مثلا رکورد رو خالی برگردونه در نتیجه چیزی نداره که بخونه و بنابرین error می ده.
تو با کوری آنالایزر به دیتابیست وصل شو و تو table هات یکسری رکورد وارد کن

ebrahimhoze
چهارشنبه 24 بهمن 1386, 08:04 صبح
اینم وب کانفیگ من اگه مشکلی داره به من بگین
<?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>
<add name="ebi" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Db.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<customErrors mode="Off"/>
<!--
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>
-->
<httpHandlers>
<add verb="GET"
path="FtbWebResource.axd"
type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" />
</httpHandlers>

</system.web>
</configuration>

maxpayn2
چهارشنبه 24 بهمن 1386, 11:30 صبح
به احتمال 98 درصد مشکل مربوط ConnectionString میشه ، با هاست تماس بگیر ، اگه ادم واردی داشته باشن در این مورد رهنماییت میکنه

ebrahimhoze
چهارشنبه 01 اسفند 1386, 23:37 عصر
با هاست تماس گرفتم این جواب رو بمن دادن.........
در حال حاضر تعداد زیادی از این string برای دیتابیس استفاده می کنند .
برای اطمینان می ت ونید با enterprise manager مصل بشید به صورت remote و وضعیت دیتابیستون رو بررسی کنید
............. من منظورشون رو نمیفهمم اگه کسی میدونه لطف کنه بمن بگه باید چی کار کنم

mp2009
پنج شنبه 02 اسفند 1386, 16:16 عصر
ببین ابراهیم جان :
این connectionstrring که تو گزاشتی روی لوکال کار میکنه .
برای هاست از این کانکشن استرینگ استفاده کن



<add name="ConnectionString" connectionString="Server=********;Database=****;User ID=****;Password=***;" providerName="System.Data.SqlClient"/>

ebrahimhoze
پنج شنبه 02 اسفند 1386, 21:21 عصر
با تشکر از پاسخ های شما ولی اگه میشه اونو با کانکشن استرینگ من وفق بدین

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Db.mdf;Integrated Security=True;User Instance=True"
اینم سایت من
www.visual-code-iran.net

kezack
پنج شنبه 02 اسفند 1386, 21:44 عصر
دوست عزیز من همین مشکل را داشتم که اخرش به این نتیجه می رسیدم که مشکل از هاست و یا ConectionString هست البته نمی دونم ولی شاید این کمکت کنه .
این 2 مثال را امتحان کن.
<connectionStrings>
<add name="ASPNETDBConnectionString" connectionString="server=(local);database=(esme
database);uid=123123;pwd=123123"
providerName="System.Data.SqlClient" />

<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=(local);database=(esme
database);uid=123123;pwd=123123"/>
</connectionStrings>

این یکی با استفاده از ip که هاست باید بهت بدن باید درست کنی.
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=34.117.64.210;Network
Library=DBMSSOCN;Initial Catalog=(esme database);User ID=123123;Password=123123;"
providerName="System.Data.SqlClient" />
</connectionStrings>
امیدوارم بدردت بخوره

ebrahimhoze
پنج شنبه 02 اسفند 1386, 22:36 عصر
اگه بانک من رمز عبور نداشته باشه باید چی کار کنم

kezack
جمعه 03 اسفند 1386, 09:48 صبح
یک رمز عبور را خودت در webConfig بزار ، آیا توی کنترل پنل سایتت یک بانک ایجاد کردی؟ که از طریق اون بانک ConnectionString را ایجاد کنی. یا هاست یک Ip بهت نداده؟