Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 29th, 2007, 07:38 AM
karym6 karym6 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Edinburgh, UK
Posts: 68 karym6 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 27 m 23 sec
Reputation Power: 5
Send a message via MSN to karym6
Connecting to MS SQL with RUby

Hi There

can anyone give me a very basic example of using Ruby to connect to an MS SQL server, along with a basic example of of a select query?

I have been trawling the Internet in vain, none of the examples I have tried so far have worked at all and I am starting to think this may be the wrong tool for the job...

Cheers
-
K

Reply With Quote
  #2  
Old October 29th, 2007, 08:15 AM
L7Sqr L7Sqr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Constant Limbo
Posts: 591 L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 13 h 51 m 38 sec
Reputation Power: 100
Send a message via AIM to L7Sqr
In order to save us the trouble of duplicating your effort, what have you tried and what error messages have you received indicating that 'it' did not work?

Until then, here are the top three hits I get from google (each with an example)
one
two
three
__________________
-- I'll provide you with reference points; if they dont work, refer to something else.

If you process text, this might make your life a little easier.

Reply With Quote
  #3  
Old October 29th, 2007, 08:17 AM
karym6 karym6 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Edinburgh, UK
Posts: 68 karym6 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 27 m 23 sec
Reputation Power: 5
Send a message via MSN to karym6
actually answered some of my own question already with this:

Code:
require 'dbi'
oConn = DBI.connect('DBI:ADO:Provider=SQLNCLI;Data Source="YOUR_DB_NAME";User ID="YOUR_DB_USERNAME";password="YOUR_DB_PASSWORD"')
oConn.select_all('YOUR_SQL_STATEMENT'){|row| puts row}


This will print everything on the screen in quite a messy way, everything is put on a new line - which is my next task

Any comments greatly appreciated - I have a feeling that Ruby and MS SQL is pretty much not used at the moment together, something I will assume changing when IronRuby debuts...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > Connecting to MS SQL with RUby


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway