* Sybase Data Provider
<ul>
- <li>ADO.NET Provider for Sybase SQL Server databases
+ <li>ADO.NET Provider for Sybase SQL Server databases</li>
- <li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient
+ <li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient</li>
- <li>Created by Tim Coleman
+ <li>Created by Tim Coleman</li>
<li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
- <a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.
+ <a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
- <li>Implemented in 100% C#
+ <li>Implemented in 100% C#</li>
- <li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.
+ <li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.</li>
- <li>Uses TDS Protocol Version 5.0
+ <li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
- <li><a href="http://www.go-mono.com/tds-providers.html">Design of the Microsoft SQL Server, Sybase, and TDS Providers in Mono</a>
+ <li>Uses TDS Protocol Version 5.0</li>
+
+ <li>Does not support trusted connections</li>
</ul>
-* Current Status
+** Current Status
<ul>
- <li>Able to connect to Sybase databases
+ <li>Able to connect to Sybase databases</li>
<li>SQL commands can be executed
- via ExecuteNonQuery() of a SybaseCommand.
+ via ExecuteNonQuery() of a SybaseCommand.</li>
<li>SQL aggregates can be executed and a single row and single column
- result can be retrieved via ExecuteScalar() of a SybaseCommand
+ result can be retrieved via ExecuteScalar() of a SybaseCommand</li>
<li>SQL queries can be executed via ExecuteReader() and results
- can be retrieved via SybaseDataReader.
+ can be retrieved via SybaseDataReader.</li>
<li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
- in a SybaseDataReader
+ in a SybaseDataReader</li>
- <li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter
+ <li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter</li>
</ul>
-* Action plan
+** Action plan
<ul>
<li>Connection timeouts is being developed now.
+
+ <li>Needs more testing...
- <li>TODO
</ul>
+
+** Testing
+
+<ul>
+ <li>Have a working mono and mcs installed</li>
+
+ <li>Have access to a Sybase database
+ or either download it:
+ <ul>
+ <li><a href="http://www.sybase.com/downloads">Sybase</a></li>
+ </ul>
+ </li>
+
+ <li>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.</li>
+
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using Mono.Data.SybaseClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=localhost;" +
+ "Database=pubs;" +
+ "User ID=myuserid;" +
+ "Password=mypassword;";
+ IDbConnection dbcon;
+ dbcon = new SybaseConnection(connectionString);
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ string sql =
+ "SELECT fname, lname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = reader["fname"];
+ string LastName = reader["lname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r Mono.Data.SybaseClient.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll -r Mono.Data.SybaseClient.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
+