4 <li>ADO.NET Provider for older Sybase and Microsoft SQL Server databases</li>
6 <li>Exists in namespace Mono.Data.TdsClient and assembly Mono.Data.TdsClient</li>
8 <li>Created by Tim Coleman</li>
10 <li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
11 <a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
13 <li>Implemented in 100% C#</li>
15 <li>Is similar to the Mono.Data.SybaseClient and System.Data.SqlClient providers.</li>
17 <li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
19 <li>Uses TDS Protocol Version 4.2 by default</li>
21 <li>Does not support trusted connections</li>
28 <li>Only builds on Windows currently due to mcs does not support modules and mcs
29 has problems with code that is internal.</li>
31 <li>Able to connect to Microsoft SQL Server and Sybase databases</li>
33 <li>SQL commands can be executed
34 via ExecuteNonQuery() of a TdsCommand.</li>
36 <li>SQL aggregates can be executed and a single row and single column
37 result can be retrieved via ExecuteScalar() of a TdsCommand</li>
39 <li>SQL queries can be executed via ExecuteReader() and results
40 can be retrieved via TdsDataReader.</li>
42 <li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
43 in a TdsDataReader</li>
45 <li>Data can be filled in a DataTable in a DataSet via a TdsDataAdapter</li>
51 <li>Connection timeouts is being developed now.</li>
59 <li>Have a working mono and mcs installed</li>
61 <li>Have access to a Sybase or Microsoft SQL Server database
62 or either download it:
64 <li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a></li>
65 <li><a href="http://www.sybase.com/downloads">Sybase</a></li>
68 <li>If using Microsoft SQL Server 2000, make sure
69 you are using at least Service Pack 3 for Microsoft SQL Server 2000</li>
71 <li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
72 named SqlTest.cs and you could use this as a basis for your test.</li>
78 using Mono.Data.TdsClient;
82 public static void Main(string[] args)
84 string connectionString =
88 "Password=mypassword;";
90 dbcon = new TdsConnection(connectionString);
91 IDbCommand dbcmd = dbcon.CreateCommand();
93 "SELECT fname, lname " +
95 dbcmd.CommandText = sql;
96 IDataReader reader = dbcmd.ExecuteReader();
97 while(reader.Read()) {
98 string FirstName = reader["fname"];
99 string LastName = reader["lname"];
100 Console.WriteLine("Name: " +
101 FirstName + " " + LastName);
114 <li>Building C# Example:
116 <li>Save the example to a file, such as, TestExample.cs</li>
119 mcs TestExample.cs -r System.Data.dll \
120 -r Mono.Data.TdsClient.dll
123 <li>Build on Windows via Cygwin:
125 mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
127 -lib:C:/cygwin/home/MyHome/mono/install/lib \
128 -r System.Data.dll -r Mono.Data.TdsClient.dll
133 <li>Running the Example: