subsonic

Help writing a linq query in subsonic

I'm busy writing some extension methods and so far have been going fine. I have a method getCities that takes in an IQueryable qry and is supposed to return all of the regions in qry that have a region type of city. I tried using linq to do it, but gave up and am currently using a for loop. It works, but its bugging me. I have comment...

SubSonic 3 ignoring columns in Select()

I have a table like so.. CREATE TABLE [dbo].[Locations_Hours]( [LocationID] [int] NOT NULL, [sun_open] [nvarchar](10) NULL, [sun_close] [nvarchar](10) NULL, [mon_open] [nvarchar](10) NULL, [mon_close] [nvarchar](10) NULL, [tue_open] [nvarchar](10) NULL, [tue_close] [nvarchar](10) NULL, [wed_open] [nvarchar](10) NULL, [...

SubSonic 3.0 - Save method with all columns as parameters?

Hi, Just getting started with SubSonic. I'm using the Repository pattern, so my domain objects are totally seperate, and SubSonic-generated classes are used only in my data access layer. I'm wondering if a template exists that will give me a Save method (Insert/Update) that requires all table column values as parameters. My thinking is ...

Make SubSonic use existing <connectionstring> instead of new data provider

I am adding SubSonic to a legacy application. This application already defines a ConnectionString. Is there a way I can use this connectionstring instead of creating a new Data Provider entry? I know that one solution is programmatically setting this in the code (i.e. SubSonic.DataService.GetInstance("Name").SetDefaultConnectionString(...

How to deal with database access in long-running 2-tier application?

I am currently working on server application that has to deal with reasonable amount of clients over TCP in LAN. Tasks that server has to accomplish vary from trivial to mildly-complex, and most of them include some form of database interaction. I'd like to make database access asynchronous, since not all queries are equally complex. Th...

Using Subsonic 3.0 Advanced Templates

Hi all, I've been trying to use Subsonic Advanced Templates in a project for a while but most of the time I find myself writing a Stored Procedure as I can't find a proper way of doing it in code. Subsonic created corresponding objects for my DB tables and for foreign keys it created IQueryable fields inside each object. These fields a...

Mysql and Subsonic 3 with LINQ: Cannot insert rows

I'm using Susbsonic 3 with the LINQ templates. I've already added a column called 'ID' to my Articles table. When I try to insert a row using the following code var db = new LDB(); int newID = db.Insert.Into<ArticlesTable> ( x => x.Description ).V...

Which ORM to use?

I'm developing an application which will have these classes: class Shortcut { public string Name { get; } public IList<Trigger> Triggers { get; } public IList<Action> Actions { get; } } class Trigger { public string Name { get; } } class Action { public string Name { get; } } And I will have 20+ more classes, whi...

SubSonic generated code and always filtering records

Hi, I have a table called "Users" that has a column called "deleted", a boolean indicating that the user is "Deleted" from the system (without actually deleting it, of course). I also have a lot of tables that have a FK to the Users.user_id column. Subsonic generates (very nicely) the code for all the foreign keys in a similar manner:...

How can I use subsonic build a query?

MY SQL: Select isnull(Max(substring(ProductId,7,4)),0) As Pid From Product where substring(ProductId,1,6)='201004' How can I use subsonic build a query? ...

Subsonic how do I filter a loaded collection?

Currently I am using Subsonic 2.1 and .NET 2.1 and I have an issue where I am attempting to filter a pre-loaded collection with 300+ items. I am using the following to attempt to preform the filter: orders = MasterOrders.Where("account", mbrAccount).Load(); The end results is setting orders equal to the entire MasterOrders collection ...

Run Custom Error using SubSonic

When I run the custom tool to create the cs files for SubSonic all the templates now inject a letter g to the top of the cs files. To get this to compile I need to remove the g from the ActiveRecord.cs, Struts.cs, Context.cs and StoredProcedures.cs. Anyone else run into this? I am using MySQL. Thanks! ...

Can't get SubSonic insert to work

I'm trying to insert a record into a table without using the SubSonic object in a VB.Net Windows app. (It will take too long to explain why.) Dim q As New SubSonic.Query("tablename") q.QueryType = SubSonic.QueryType.Insert q.AddUpdateSetting("Description", txtDescription.Text) q.Execute() This just updates all the rows in the table. I ...

SubSonic template with MySQL

When I run the custom tool to create the cs files for SubSonic all the templates now inject a letter g to the top of the cs files. To get this to compile I need to remove the g from the ActiveRecord.cs, Struts.cs, Context.cs and StoredProcedures.cs. Anyone else run into this? I am using MySQL. ...

SubSonic - Scaffoling with ObjectDataSource

Using SubSonic v2.2, I'd like to use the scaffolding control. All my data access is done through stored procedures, and as so, I'm wondering if this will be possible, as there are only execute permissions on my sprocs, and no direct table access? Thanks. ...

Subsonic and .Net 4.0

Does Subsonic support .Net 4.0? ...

subsonic 2 join on multiple columns

I want to transfer the following statement to SubSonic 2.2 SELECT b.* FROM tableA a INNER JOIN tableB b ON (a.year = b.year AND a.month = b.monath AND a.userid = b.userid); My problem is that SubSonic's SqlQuery.LeftInnerJoin() command has no overload which takes more than one column. Since any join can be rewri...

Can I use an ORM (as Subsonic) to work with an API?

Hello ... I´m new to ORMs and I have a new project I´ll do in .Net MVC. In the Model Layer I´ll create my classes: Videos and I´ll work with APIs as a DataLayer (BrightCove & YouTube APIs). So, I dont have a Relational Database as a Data Layer. Is it possible to work with an ORM (as Subsonic)? Thanks! ...

SubSonic missing stored procedures in StoredProcedures.cs when generated with SubCommander sonic.exe

We have been using SubSonic to generate our DAL with a lot of success on VS2005 and SubSonic Tools 2.0.3. SubSonic Tools do not work on VS2008 (as far as we can work out) so we have tried to use SubCommander\sonic.exe and are now hitting some problems. When we regenerate the project using SubCommander\sonic.exe and try to compile we ge...

Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script

I've got a DLL that contains Subsonic-generated and augmented code to access a data model. Actually, it is a merged DLL of that original assembly, Subsonic itself and a few other referenced DLL's into a single assembly, called "PowershellDataAccess.dll. However, it should be noted that I've also tried this referencing each assembly indiv...