نمایش نتایج 1 تا 12 از 12

نام تاپیک: A connection was successfully established with the server, but then an error occurred

  1. #1

    A connection was successfully established with the server, but then an error occurred

    A connection was successfully established with the server, but then an error occurred during the pre-login handshake. 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: Shared Memory Provider, error: 0 - The system cannot open the file.)
    سلام
    کسی تا حالا با این پیغام برخورد کرده؟

  2. #2
    آیا remote connection در sql server شما enable هست؟

  3. #3
    آره
    من connect میشم بعد از اینکه چند تا فرم باز و بسته شد این پیغام رو میده
    روی فرم خاصی نیست

  4. #4
    آره
    من connect میشم بعد از اینکه چند تا فرم باز و بسته شد این پیغام رو میده
    روی فرم خاصی نیست
    آیا کانکشن ها به دیتابیس از داخل برنامه دستکاری میشن؟
    آیا عملیات drop database یا alter database یا چنین کارهایی که باعث تغییر کانکشن ها بشه توی کد فرمها دارید؟

  5. #5
    زیاد با database کار میکنم

  6. #6


    I guess the problem is the connection pool. Recall that when you close
    a connection from your .Net app, the connection to SQL Server is not
    really closed. Instead ADO .Net lingers to it, for another 60 seconds,
    and if the applicaiton opens a new connection during this time, it will
    reuse the connection.

    When you issue ALTER DATABASE WITH ROLLBACK IMMEDIATE, SQL Server will
    terminate these connections. However, this is not something that ADO .Net
    can detect. So it gives you a connection which it thinks is good, but
    which isn't.

    There are a couple of ways to approach this. One is to configure the
    connection pool, so that all connections are dropped when you drop the
    database. Another is to change the connection string, each time you
    drop the database, as different connection strings gives different pools.

    I would suggest that the best way, though, is simply to set up an exception
    handler, so that you simply trap this error, and then try to reconnect.

    For the fine details on how to implement any of the above, I would suggest
    that microsoft.public.dotnet.framework.adonet is a better venue, as the
    issue involved here is more one with SqlClient rather than SQL Server.


    منبع:
    http://www.thescripts.com/forum/thread476823.html

  7. #7
    یعنز کانکشنم رو جایی نبستم؟
    یا اینکه بستم و میخوام دوباره ازش استفاده کنم؟

  8. #8
    نه چیزی که اینجا میگه اینه که بعضی مواقع مثل alter database ای که مثال زده اینجا، این حالت ÷یش میاد که کانکشن از طرف SQLServer بسته میشه ولی از طرف ADO.NET بسته نمیشه و یه کانکشن InValid ایجاد میشه:

    When you issue ALTER DATABASE WITH ROLLBACK IMMEDIATE, SQL Server will
    terminate these connections. However, this is not something that ADO .Net
    can detect. So it gives you a connection which it thinks is good, but
    which isn't.


    اما راه حل:

    There are a couple of ways to approach this. One is to configure the
    connection pool, so that all connections are dropped when you drop the
    database. Another is to change the connection string, each time you
    drop the database, as different connection strings gives different pools.

    I would suggest that the best way, though, is simply to set up an exception
    handler, so that you simply trap this error, and then try to reconnect.


  9. #9
    من متوجه راه حل نمیشم
    اگه امکان داره فارسی توضیح بدید

  10. #10
    کانکشن رو بعد از دستوراتی مثل drop database و ... ببندید. بعد کانکشن استرینگ رو تغییربدید و کانکشن جدیدی ایجاد کنید و ...

  11. #11
    من همه connection ها رو بعد از هر query میبندم و یه sql connection جدید برای command جدید ایجاد میکنم اما هنوز مشکل دارم

  12. #12
    نقل قول نوشته شده توسط m_zamani مشاهده تاپیک
    A connection was successfully established with the server, but then an error occurred during the pre-login handshake. 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: Shared Memory Provider, error: 0 - The system cannot open the file.)
    سلام
    کسی تا حالا با این پیغام برخورد کرده؟
    دوست عزیزم از کدوم Edition استفاده میکنین؟ منظورم SQL Server هست

تاپیک های مشابه

  1. provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server
    نوشته شده توسط rasame در بخش ASP.NET Web Forms
    پاسخ: 1
    آخرین پست: شنبه 01 دی 1386, 11:29 صبح
  2. این مشکل معمولا کی پیش میاد my sql connection error
    نوشته شده توسط samaneh_h در بخش PHP
    پاسخ: 15
    آخرین پست: چهارشنبه 27 دی 1385, 10:08 صبح
  3. A generic error occurred in GDI+.
    نوشته شده توسط hamhik در بخش ASP.NET Web Forms
    پاسخ: 6
    آخرین پست: سه شنبه 28 آذر 1385, 22:26 عصر
  4. "Error 1609. An error occurred while appliying security
    نوشته شده توسط سمیه در بخش ASP.NET Web Forms
    پاسخ: 2
    آخرین پست: سه شنبه 15 دی 1383, 11:23 صبح
  5. Connection faild error
    نوشته شده توسط vahidhamid در بخش SQL Server
    پاسخ: 1
    آخرین پست: یک شنبه 14 تیر 1383, 20:19 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •