From: Raveendran Jazzez Date: 2008-05-07T21:23:44+09:00 Subject: Re: Code for connecting to SQL Server? Hi Anukul, Try this. I am working windows here. TRY.rb *************************************************************** =begin OS : Windows here Ruby : 1.8.6 DB :Mysql Gem :> gem install mysql =end require "mysql" #require mysql gem connection = Mysql.connect("localhost", "root", "", "cdcol") #localhost = hostname #root = username of mysql DB #""=password of mysql DB #cdcol = DB name output = connection.query("SELECT * FROM cds;") #cds = table name output.each do |x| puts x.inspect end *************************************************************** Regards, P.Raveendran Railsfactory http://raveendran.wordpress.com -- Posted via http://www.ruby-forum.com/.