The Cobra Programming Language
How To
Print Hello World
Write Basic Syntax
Use Properties
Make An If Else Ladder
Make A Branch Statement
Declare Inits
Make A Class Hierarchy
Use Nil And Nilable Types
Use Dynamic Typing
Declare Variable Number Of Args
Read And Write Files
Check Inheritance And Implementation
Pass References To Methods
Translate Pseudo Code To Cobra1
Translate Pseudo Code To Cobra2
Implement IEnumerable1
Implement IEnumerable2
Iterate Through Recursive Data With Yield
Make A Collection Class
Declare Contracts
Threads
Win Forms
GTK
Access MySQL
""" See also: docs/mysql on the Cobra web site http://www.mono-project.com/MySQL http://www.mono-project.com/Category:ADO.NET http://www.mono-project.com/Using_Databases "Installing Connector/NET on Unix with Mono" http://dev.mysql.com/doc/refman/5.0/en/connector-net-installation-unix.html To run: cobra -r:System.Data -r:MySql.Data AccessMySQL.cobra Or just compile: cobra -c -r:System.Data -r:MySql.Data AccessMySQL.cobra and then run: mono mysql.exe Mac OS X: For installation, MySQL docs say "Copy the MySql.Data.dll file to your Mono project installation folder." $ cp bin/MySql.Data.dll /Library/Frameworks/Mono.framework/Libraries/ """ use System.Data use MySql.Data.MySqlClient class Program def main is shared connectionString = 'Server=localhost;Database=mysql;User ID=root;Password=;Pooling=false' using conn = MySqlConnection(connectionString) # IDbConnection conn.open using cmd = conn.createCommand # IDbCommand sql = 'select * from user;' cmd.commandText = sql using reader = cmd.executeReader # IDataReader while reader.read userName = reader['User'] host = reader['Host'] print 'userName=[userName], host=[host]'