subsonic

SubSonic column named 'Key'

Hi! I have a column named 'Key' in a MySQL database. Seems that the repo.Find<Class>(x=>x.Key.StartsWith("BLAH")); generates the SQL code WHERE Key LIKE 'BLAH%' instead of the correct one like WHERE `Key` LIKE 'BLAH%' How can I force the later behaviour (is it a bug in SubSonic?) Cheers, Tomasz ...

Generating edit pages with Subcommander

Has anyone used Subcommander to generate views or edit aspx pages in webforms projects. If so any tips/help advice or alternatives would be really helpful. ...

Subsonic Count Distinct

enter code hereHow do I get the distinct count the ProdID column in this aggregate query? Dim query As SubSonic.SqlQuery = New SubSonic.Select(SubSonic.Aggregate.GroupBy(TOrders.DelivDateColumn, "DelivDate"),SubSonic.Aggregate.Count(TOrders.ProdIdColumn, "ProdId")).From(of TOrders) If I add Distinct() at the end, its working on the re...

Adding a Join to an existing var: not a sequence

(SubSonic) I have this initial declaration to do a simple join. var ji = from pli in PriceListItem.All( ) join ci in CatalogItem.All( ) on pli.CatalogItemID equals ci.CatalogItemID select new { pli = pli, ci = ci }; Before executing the sql, under some circumstance, I want to add a join to an in-memory list. When I...

Subsonic where (firstname + ' ' + Surname) Like How to do in Subsonic?

Hello! I am trying to convert a stored proc over to subsonic and the store proc contains something like this: SELECT * FROM Person WHERE (Firstname + ' ' + Surname) LIKE '%name%' How do I do this in subsonic? Thanks for any help! Bex ...

SubSonic How to provide a column name in a generic method

Using SubSonic3, I have this generic method (thanks to linq guy, James Curran): public List<T> GetFromList<T>( List<Guid> _IDs, Func<T, Guid> GetID, Func<IQueryable<T>> GetAll ) where T : class, IActiveRecord { List<T> rc = null; var Results = from item in GetAll( ) ...

Subsonic query, i suck!

Hi all, I'm using subsonic 2.2 in one of my projects. I'm have a comment section where i query one table called Comments. First I query all records with ParentId=0, and then in the foreach statement I query all records with ParentId=currentRecord.Id. Now I know this is a bad habit but I don't know how to get around this in a single quer...

Subsonic 3.0 TestRepository "Find" not working

Using Subsonic 3, I have a simple class called "ConferenceRepository" that has a method that returns a bunch of conferences based on their status. I am testing this using SubSonic's built in support for testing. My setup of the repo looks like this: // 2 Approved, 4 pending, 3 rejected var data = new List<Conference> { ...

How does one do an Oracle top-n (paged) query in SubSonic 2.2?

(Disclaimer: I changed/obfuscated some of the variable/table/column names here for security reasons. Please forgive me if something looks a little off.) I am building a front-end to an Oracle 10g database, and I'm trying to get paged data. Aside from paging, the following SubSonic 2.2 code gives me what I want, in the order I want it:...

Subsonic Single WHERE clause

Is it possible to apply a WHERE clause on a SubSonic query? For example, I get get a single based on id... db.Single<Storage>(id); But how can I get a single based on a simple WHERE clause? db.Single<Storage>(WHERE columnname == "value"); ...

using subsonic with vb.net

I'm quite comfortable with VB and have a very large project i need to do. I've come across SubSonic and it looks awesome. I am not clear if i can use it in VB. I've seen a a couple of posts that suggest they did but on the site it specifically shows C#. Can I use SubSonic with VB.NET? ...

Subsonic, mysql error, Structs.tt, run custom tool

Using VS 2008 and SubSonic and MySQL 4.1 and MySQL Connector 6.2.4... running the custom tool on any of the .tt files receives this exception. Now my guess is this is an issue outside of SubSonic. Error 2 Running transformation: System.NullReferenceException: Object reference not set to an instance of an object. at MySql.Data.MySqlC...

SubSonic - Generated Classes have the following error - the type or namespace name does not exist in KimDal

Hi Guys Im trying to generate my dal and this works but when i check my code in visual studio 2008 i get this message "the type or namespace name does not exist in KimDal" Im using sql expreess 2005, full version of vs2008, and i setup a new c# 2.0 website. I installed the 2.1 installer for subsonic, add added it to my external tools,...

SubSonic - How can i create my business logic layer

Hi Guys Im new to subsonic and generally this was of programming, i usually develop from a rad perspective so using the visual studio dataset designer, but i wanted to start looking at developing n teir approach. Ive never used a business logic layer, (naughy) normally my code behind takes care of validation so to speak aswell as gener...

Subsonic - Where do i include my busines logic or custom validation

Hi Guys Im using subsonic 2.2 I tried asking this question another way but didnt get the answer i was looking for. Basically i ususally include validation at page level or in my code behind for my user controls or aspx pages. However i haev seen some small bits of info advising this can be done within partial classes generated from s...

Subsonic 3 - Can't decide which property to consider the Key

Hi guys! Is there somethink like a documentation for subsonic 3? I'm just beginning to use it and have a lot of questions. First up this error message: "Can't decide which property to consider the Key - you can create one called 'ID' or mark one with SubSonicPrimaryKey attribute" The code in question is generated by the context.t...

SUBSONIC using subcommander via VS2008 causing following errors - help please

Hi Guys Ive been using subcommander to generate my dal. Im using vb.net and sqlexpress and .net 3.5 My webconfig looks like this <!-- add subsonic in for dal--> <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" requirePermission="false"/> </configSections> <connection...

SubSonic: Overriding the Scaffold

Can anyone advise me on extending the out-of-the-box scaffold within SubSonic 2? When a user clicks the Save button, which triggers the btnSave_Click void, I would like to execute another stored procedure based on the record they have just updated. What's the best approach? Many thanks. ...

Subsonic 2.0.3: Save() causes problem due to identity field constraint

Here's a strange one. I'm using SubSonic 2.0.3 to insert a new row into a given table. The table includes an int identity field that is set up properly in the database (Identity seed = 1, Identity increment = 1). Obviously I do not explicitly set this value before calling .Save(). Ever since I rebuilt my development DB (copying fro...

Linq query Join objects with different data sources?

I am trying to join two objects, the first is a (static) local object defined in a Helper and the second (Subsonic) Database object. Here is the offending extract from my repository, I wont bore you with the models and helpers unless requested. public IQueryable GetData(string DataType) { IQueryable<DatabaseObject> dat...