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

نام تاپیک: انواع connection strings برای SQL Server 2005

  1. #1
    کاربر دائمی
    تاریخ عضویت
    بهمن 1382
    محل زندگی
    فعلا ایران - فعلا تهران
    پست
    2,628

    انواع connection strings برای SQL Server 2005

    SQL Native Client ODBC Driver
    Standard security:

    "Driver={SQL Native Client};Server=Aron1;Database=pubs;UID=sa;PWD=asda sd;"



    Trusted connection:





    "Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connect ion=yes;"
    Equivalents

    Integrated Security=SSPI equals Trusted_Connection=yes







    Prompt for username and password:


    oConn.Properties("Prompt") = adPromptAlways
    oConn.Open "Driver={SQL Native Client};Server=Aron1;DataBase=pubs;"


    Enabling MARS (multiple active result sets):








    "Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connect ion=yes;MARS_Connection=yes"
    Equivalents

    MultipleActiveResultSets=true equals MARS_Connection=yes

    Using MARS with SQL Native Client, by Chris Lee >>







    Encrypt data sent over network:


    "Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connect ion=yes;Encrypt=yes"


    Attach a database file on connect to a local SQL Server Express instance:
    "Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\as d\qwe\mydbfile.mdf;Database=dbname;Trusted_Connect ion=Yes;"
    - or -
    "Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=|Data Directory|mydbfile.mdf;Database=dbname;Trusted_Con nection=Yes;"
    (use |DataDirectory| when your database file resides in the data directory)





    Why is the "Database" parameter needed? Answer: If the database was previously attached, SQL Server does not reattach it (it uses the attached database as the default for the connection).Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME\SQLEXPRESS (Substitute "SERVERNAME" with the name of the computer)





    Download the SQL Native Client here >> (the package contains booth the ODBC driver and the OLE DB provider)











    SQL Native Client OLE DB Provider
    Standard security:

    "Provider=SQLNCLI;Server=Aron1;Database=pubs;UID=s a;PWD=asdasd;"



    Trusted connection:








    "Provider=SQLNCLI;Server=Aron1;Database=pubs;Trust ed_Connection=yes;"
    Equivalents

    Integrated Security=SSPI equals Trusted_Connection=yes







    Prompt for username and password:


    oConn.Properties("Prompt") = adPromptAlways
    oConn.Open "Provider=SQLNCLI;Server=Aron1;DataBase=pubs;"


    Enabling MARS (multiple active result sets):








    "Provider=SQLNCLI;Server=Aron1;Database=pubs;Trust ed_Connection=yes;MarsConn=yes"
    Equivalents

    MarsConn=yes equals MultipleActiveResultSets=true equals MARS_Connection=yes

    Using MARS with SQL Native Client, by Chris Lee >>







    Encrypt data sent over network:


    "Provider=SQLNCLI;Server=Aron1;Database=pubs;Trust ed_Connection=yes;Encrypt=yes"


    Attach a database file on connect to a local SQL Server Express instance:
    "Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFile name=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trust ed_Connection=Yes;"
    - or -
    "Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFile name=|DataDirectory|mydbfile.mdf;Database=dbname;T rusted_Connection=Yes;"








    (use |DataDirectory| when your database file resides in the data directory)
    Why is the "Database" parameter needed? Answer: If the database was previously attached, SQL Server does not reattach it (it uses the attached database as the default for the connection).





    Download the SQL Native Client here >> (the package contains booth the ODBC driver and the OLE DB provider)





    Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME\SQLEXPRESS (Substitute "SERVERNAME" with the name of the computer










    SqlConnection (.NET)
    Standard Security:

    "Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
    - or -
    "Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
    (both connection strings produces the same result)




    Trusted Connection:
    "Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
    - or -
    "Server=Aron1;Database=pubs;Trusted_Connection=Tru e;"
    (both connection strings produces the same result)






    (use serverName\instanceName as Data Source to use an specifik SQLServer instance)





    Connect via an IP address:










    "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
    (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))





    Enabling MARS (multiple active result sets):










    "Server=Aron1;Database=pubs;Trusted_Connection=Tru e;MultipleActiveResultSets=true"
    Note! Use ADO.NET 2.0 for MARS functionality. MARS is not supported in ADO.NET 1.0 nor ADO.NET 1.1


    Streamline your Data Connections by Moving to MARS, by Laurence Moroney, DevX.com >>







    Attach a database file on connect to a local SQL Server Express instance:


    "Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\m ydbfile.mdf;Database=dbname;Database=dbname;Truste d_Connection=Yes;"
    - or -
    "Server=.\SQLExpress;AttachDbFilename=|DataDirecto ry|mydbfile.mdf;Database=dbname;Trusted_Connection =Yes;"








    (use |DataDirectory| when your database file resides in the data directory)
    Why is the "Database" parameter needed? Answer: If the database was previously attached, SQL Server does not reattach it (it uses the attached database as the default for the connection).





    Using "User Instance" on a local SQL Server Express instance:










    "Data Source=.\SQLExpress;integrated security=true;attachdbfilename=|DataDirectory|\myd b.mdf;user instance=true;"
    The "User Instance" functionality creates a new SQL Server instance on the fly during connect. This works only on a local SQL Server 2005 instance and only when connecting using windows authentication over local named pipes. The purpose is to be able to create a full rights SQL Server instance to a user with limited administrative rights on the computer. To enable the functionality: sp_configure 'user instances enabled','1' (0 to disable)





    Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME\SQLEXPRESS (Substitute "SERVERNAME" with the name of the computer)








    Context Connection - connecting to "self" from within your CLR stored prodedure/function
    C#‎:

    using(SqlConnection connection = new SqlConnection("context connection=true"))
    {
    connection.Open();
    // Use the connection
    }




    Visual Basic:
    Using connection as new SqlConnection("context connection=true")
    connection.Open()
    ' Use the connection
    End Using










  2. #2
    کاربر دائمی
    تاریخ عضویت
    دی 1383
    محل زندگی
    همه جای ایران سرای من است
    پست
    504
    ممنون آقای زواری

  3. #3
    مرسی فکر برای خیلی ها مفید باشه همچنین خودم

  4. #4
    خیلی جالب بود آقای زواری.

  5. #5

    نقل قول: انواع connection strings برای SQL Server 2005

    آدرس سایتی مطلب رو برداشتی رو هم بنویس تا ....

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

  1. Connection SQL 2000 client to SQL Server 2005
    نوشته شده توسط ranginkaman در بخش SQL Server
    پاسخ: 3
    آخرین پست: یک شنبه 07 بهمن 1386, 13:02 عصر
  2. تعریف Connection String اتصال به Sql server 2005
    نوشته شده توسط larim2007 در بخش C#‎‎
    پاسخ: 1
    آخرین پست: پنج شنبه 27 اردیبهشت 1386, 22:22 عصر
  3. connection در vb.net 2005
    نوشته شده توسط nazila_f در بخش گزارش سازی با Crystal Report
    پاسخ: 3
    آخرین پست: دوشنبه 03 اردیبهشت 1386, 10:56 صبح
  4. palindram strings
    نوشته شده توسط akb_behnam در بخش الگوریتم، کامپایلر، هوش مصنوعی و ساختمان داده ها
    پاسخ: 13
    آخرین پست: سه شنبه 12 دی 1385, 12:37 عصر
  5. Managing Connection Strings for Web Farms in ASP.NET 2.0
    نوشته شده توسط HO457 در بخش ASP.NET Web Forms
    پاسخ: 0
    آخرین پست: جمعه 15 اردیبهشت 1385, 10:16 صبح

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

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