Currently I am using a DLL Library to get lists of custom objects.
Which is all great, for being able to use it in other projects.
But I want a dropdown box, which is a lookup of a DB table, with literally 3 options, (High, medium, low) and this isnt the only case that this is a problem.
Is there any short way of getting such info?
In ROR you could literally call SQL String to a db and get the list, with just one line of code.....
So Id like something like:
var mylist = sqldb.query("SELECT * FROM Priority");
Note: yes the above is completely made up.
Ideally I wouldnt have to set up any models either... and ideally also not have to attach a DB, rather use a query string- unless attaching is far easier and can be customised from the config file.
Update:
following an example, I now ahve the following, but it says System.ArgumentException: Keyword not supported: 'initial catalog'.
using (var db = Database.OpenConnectionString(WebLite.Properties.Settings.Default.dbConnString))
{
var items = db.Query("SELECT * FROM TaskPriority");
}
My connection string: Data Source=MYPC\WEB;Initial Catalog=WEBSQL;User ID=sa;Password=password;