TAILIEUCHUNG - Create a Dialog Box to Connect to a New Database, Including Listing Available SQL Servers and Databases

7,1 Tạo một Dialog Box để kết nối đến một cơ sở dữ liệu mới, bao gồm danh mục Available SQL Server và cơ sở dữ liệu người dùng đôi khi cần phải kết nối với cơ sở dữ liệu khác nhau. | Create a Dialog Box to Connect to a New Database Including Listing Available SQL Servers and Databases Users sometimes need to connect to various databases. An example of this is a large company that might keep its site information in separate databases in the same-or even different-SQL Servers. Management might need to point the application to different site databases depending on which one it needs to work with. This How-To shows you how to create a dialog box to let the user pick the SQL Server and database and then create a new connection based on the selections. Within a database application it is necessary to allow users to select a SQL Server back end to which to connect. If you have created my application with the necessary flexibility you should not have hard-coded SQL Server or database names within my application. How do you create a dialog box that lists available SQL Servers and databases and that the user can utilize to connect to a new database Technique For this How-To you will be using the base object in SQL-DMO which is the Application object and then the SQLServer object. You can use many objects off this object the first layer of which is shown in Figure . Figure . These are just the tip of the iceberg as far as collections and objects used in SQL-DMO. Table presents the objects properties and methods that will be used for this -To. Table . SQL-DMO Objects Used for Listing SQL Servers Databases and Connecting to a Database Object Property Method Description Application NameList Collection used to hold the list of available servers ListAllAvailableServers Method used to retrieve available servers on the network SQLServer Connect Connection string that connects you to the SQL Server allowing you access to the databases LoginSecure Flag that specifies that you want to connect to the SQL Server using a trusted connection Databases Collection of databases for the specified SQL Server You will also be using the OleDbConnection object.

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.