Hi there Orion,

Firstly, thanks very much for the prompt reply! I tried using IronRuby 
to query against my local sql server and SQL Azure. I'm a Ruby noob but 
I've listed below what I used.

I'm able to query against both SQL servers and obtain the time and 
servername using Transact-SQL. As mentioned earlier, however, I was 
unable to use rails to connect to SQL Azure.

The SQL Azure credential I've listed below is real and can be used for 
testing.

Any other ideas?

test script:
-----------
require 'mscorlib'
require 'System.Data, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089'

include System::Data::SqlClient

#connection = 
SqlConnection.new('Server=.;Database=dev;Uid=myuser;pwd=...@ssw0rd')
connection = 
SqlConnection.new('Server=nrvk7uv6tl.database.windows.net;Database=cloudoman;Uid=myuser;pwd=...@ssw0rd')
connection.open

command = SqlCommand.new("SELECT getdate() as my_date, @@SERVERNAME AS 
my_name",connection)

my_reader = command.execute_reader()
my_reader.each do |x|
  puts "Server Name: #{x['my_name'].to_s}"
  puts "Time: #{x['my_date'].to_s}"
end

my_reader.close
connection.close



Orion Edwards wrote:
> My guess is that SQL Azure doesn't follow quite the same protocol as 
> normal
> SQL Server. As I don't have a SQL azure account, I can't play around 
> with it
> myself, but I'd suggest trying to get a simple command line version of
> IronRuby up and running and see if you can use the raw sqlserver adapter 
> to
> connect to SQL azure at all?


-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to