http://www.brentozar.com/archive/2009/09/whats-on-my-bookshelf/
// Open a connection to the database SybaseConnection Conn; Conn = new SybaseConnection( "host=server1;port=4100;User ID=test;Password=test; Database Name=Accounting"); Conn.Open(); // Open a command object SybaseCommand salCmd = new SybaseCommand( "SELECT count(sal) FROM employees" + "WHERE sal>'50000'", Conn); try { int count = (int)salCmd.ExecuteScalar(); } catch (Exception ex) { // Display exceptions in a message box MessageBox.Show (ex.Message); } // Close the connection Conn.Close();













