X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fsqlclient;h=1cce85fd09b083c72d8dda75028e543420e14757;hb=79621d46b5a1e802afc557fbbffeed9eab9ea239;hp=df76f9d620a70da1dc2435f950fdce7482152f27;hpb=c40860f8f6073bf2e89beb08857b7e5b1cfb39bc;p=mono.git diff --git a/web/sqlclient b/web/sqlclient index df76f9d620a..1cce85fd09b 100755 --- a/web/sqlclient +++ b/web/sqlclient @@ -18,7 +18,12 @@
  • Uses TDS Protocol Version 7.0
  • -
  • Does not support trusted connections
  • +
  • Bugs with Mono or the data provider should be reported + in Mono's Bugzilla here. If you + do not have Bugzilla user account, it is free + and easy to + create one here.
  • + @@ -55,14 +60,20 @@
  • Uses TDS Protocol Version 7.0
  • Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono
  • + +
  • Works in the SQL# command-line and GTK# GUI version
  • ** Action plan @@ -78,9 +89,64 @@ +
  • If using Microsoft SQL Server 2000, make sure + you are using at least Service Pack 3 for Microsoft SQL Server 2000. If using + MSDE 2000, make sure you have the special Service Pack 3 for MSDE 2000.
  • + +
  • For those that only have MSDE installed. You can change the authentication mode + from Windows Only Authentication to SQL Server and Windows Authentications (also knows as Mixed-mode authentication) + via the registry
  • . It is + the LoginMode you need to change. By default, + MSDE is installed with Windows Only Authentication. For SqlClient to work with MSDE, you will + need to change the setting. + +
  • If using MSDE, you might need to create a new user with password. Give + this user access to various databases in this MSDE instance. Also, for each + database, give this new user at least SELECT access to the various tables you want + to retrieve data from.
  • + +
  • If you have Enterprise Manager, you can easily change the authentication mode + for both MSDE and Microsoft SQL Server. To change the authentication mode in + Enterprise Mananger, select the instance, right-click on it, and select properites. + The SQL Server properties dialog for that instance will pop up. Choose the Security + tab. Change the authentication from Windows Only to SQL Server and Windows. If + the instance of your database does not show up in Enterprise Manager, Register first + by selecting the Action menu and choosing New SQL Server Registration.
  • +
  • Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient named SqlTest.cs and you could use this as a basis for your test.
  • +
  • Mono's SqlClient does not support trusted connections + nor integrated security. You can not use this when connecting. You need + to explicitly use a User ID and Password + authenticated by SQL Server.
  • + +
  • Has a connection string format: +
    + Server=hostname;Database=databaseName;User ID=userid;Password=password
    +
    +
  • +
  • The Server part can be used three ways: + + + + + + + + + + + + + + + + + +
    Server Definition Example
    hostname Server=MYHOST
    hostname,port Server=MYHOST,1433
    hostname\\instance Server=MYHOST\\NETSDK
    +
  • +
  • C# Example:
      using System;
    @@ -94,15 +160,16 @@
            string connectionString = 
               "Server=localhost;" +
               "Database=pubs;" +
    -          "User ID=sa;" +
    -          "Password=;";
    +          "User ID=myuserid;" +
    +          "Password=mypassword;";
            IDbConnection dbcon;
            dbcon = new SqlConnection(connectionString);
    +       dbcon.Open();
            IDbCommand dbcmd = dbcon.CreateCommand();
            string sql = 
                "SELECT fname, lname " +
                "FROM employee";
    -       dbcmd.ConnectionString = sql;
    +       dbcmd.CommandText = sql;
            IDataReader reader = dbcmd.ExecuteReader();
            while(reader.Read()) {
                 string FirstName = reader["fname"];