X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fsybase;h=85deca1a67cd8afd5c38660f407d40e5db0d6f81;hb=b252d1787cadf407f0a1c40c16651d2b9e817f33;hp=6a3b859c5b18b879a388093925c83f56ed04e368;hpb=c40860f8f6073bf2e89beb08857b7e5b1cfb39bc;p=mono.git diff --git a/web/sybase b/web/sybase index 6a3b859c5b1..85deca1a67c 100755 --- a/web/sybase +++ b/web/sybase @@ -17,8 +17,14 @@
  • Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.
  • Uses TDS Protocol Version 5.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.
  • + + ** Current Status @@ -65,6 +71,18 @@
  • 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.
  • +
  • Has a connection string format: +
    + Server=hostname;Database=databaseName;User ID=userid;Password=password
    +
    +
  • +
  • The Server part can be used two ways: + +
  • +
  • C# Example:
      using System;
    @@ -78,19 +96,20 @@
            string connectionString = 
               "Server=localhost;" +
               "Database=pubs;" +
    -          "User ID=sa;" +
    -          "Password=;";
    +          "User ID=myuserid;" +
    +          "Password=mypassword;";
            IDbConnection dbcon;
            dbcon = new SybaseConnection(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"];
    -            string LastName = reader["lname"];
    +            string FirstName = (string) reader["fname"];
    +            string LastName = (string) reader["lname"];
                 Console.WriteLine("Name: " + 
                      FirstName + " " + LastName);
            }