subsonic3

Using Subsonic3 with Linqpad

Has anyone been able to get subsonic objects to work in linq pad , the problem i have at the moment is that it cant find the connection string when ever I try to run my code. I have tried adding the connection string to the linqpad config file as well as copying the original config file from the project that contains the connection stri...

SubSonic 3 Linq Joining error after using CleanUp

I am using the ActiveRecord SubSonic3 templates. Everything was working just dandy, then I decided I wanted things to look a bit better. See my database has field that look like this: SomeKey_id SomeOtherKey_id I wanted to clean it up so that it would instead be SomeKeyID SomeOtherKeyID when accessing it through SubSonic. So I ad...

Issue with Linq Join (subsonic)

I have this slice of code IQueryable<Dealer> dealers = from dealer in Dealers join address in AddressesUS on dealer.DealerId equals address.OwnerId where dealer.Country == country && address.Owner == (int)Contact.OwnerType.Dealer select new Dealer() { DealerId = dealer.DealerId, DealerName = dealer.De...

SubSonic not recognizing SQLite foreign keys

I'm using SubSonic 3.0.0.3 and I can't seem to get the ActiveRecord .tt files to recognize and generate code for the foreign keys and relationships in my SQLite database. I think it generates everything else just fine, but after looking at other snippets online it looks like there should be more generated code than just single classes ...

Error on updating record with Subsonic (MySql)

Hi, I am using the following code to update a record in my table: var usr = test.Data.user.SingleOrDefault(y => y.id == 1); usr.name = "test"; usr.Save(); retrieving the row works perfectly but when I Save() I get a NullReferenceException breaking in the file database.cs line 412, which...

Subsonic Build error.

i am new to subsonic, i am trying to use subsonic 3.0 i followed every steps to set up subsonic Problem is i am trying to use subsonic3.0 in a web project (with dotnetnuke) to create a dll file. so i can re use in other projects in the same solution. when i try to build i got error with one of my old table column, Error 5 Cannot im...

Select new to create complex object with nested new throws cast exception

Has anyone had this issue? I am trying to get objects from the database and create a complex poco but I get a cast issue. The Account property on the poco message type is a poco account type and it will tell me that whatever the first field type is can't be cast to PocoAccount, so in the example below, AccountID is an int so i'll get in...

SubSonic 3.0 , I'm missing SubSonic.Query

I probably missed something in the .tt configuration for some reason my intellisense when I type SubSonic.Query or Query = new Query(DB.Table) is not highlighting and giving me an error. Anybody has a problem like this? appreciate any help. thanks ...

subsonic bug? ExpressionVisitor linq

Hi, I have a problem with this subsonic3.0.0.4 find statement: IList<Market> marketlist = marketlRep.Find<Market>( type => type.MarketType == Convert.Int32(MarketType)). OrderBy(type => type.DisplayOrder).ToList(); There are four the number of data in the database, but the list returned is empty Use the following form, you...

How to configure subsonic 3 with xml?

How to configure subsonic 3 with xml? ...

Subsonic DAL fails compilation on columns which are keywords

I'm using Subsonic 3 (Active Record), VS2010, Framework 3.5 against a MySQL database. Someone named a column "string." I S@*t you not. OK, I've named some database objects some dumb names (Like naming a SQL Server table "User") before but... c'mon! And I cannot change the table because of dependencies in the app! OK I feel a little b...

T4 templates in VS 2010 Cannot Find Metada file SubSonic.Core.dll

I am using Subsonic 3 to generate DAL. Further I am using T4 templates to generate my BOs from DAL. Subsonic's T4 templates are working properly, but when I run my templates it gives me following error: Compiling transformation: Metadata file 'SubSonic.Core.dll' could not be found I have imported SubSonic in my settings.include file l...

SQLite and sub-sonic

Does Subsonic supports SQLite, if so can subsonic work with Win7 Phone ? ...

SubSonic 3, Entity Data Model (Entity Framework) or LINQ to SQL for ASP.NET MVC development?

Having used all of them (some more than others), I am still undecided on which could be the best to use (with .NET 3.5). What are the pro's and con's of each when developing? SubSonic 3 Not enough samples/documentation (I know its a wiki and people can update it, but it can be tricky to track things down - e.g. where are the sample apps...

Subsonic 3.0.0.3 throws System.InvalidOperationException: Timeout expired.

Dear all, I've set up my system with .NET framework 3.5, SQL server and Subsonic 3.0.0.2. I've added the subsonic files in Visual Studio. The first time I try to update my file(s) with "Custom Tool" within Visual Studio is successful. But when I try to do this several times I get the error: I've updated subsonic to 3.0.0.3, but still ...

Howto build Subsonic 3 qeury with dynamic table and column names using reflection

I would like to construct a dynamic Subsonic 3 query using code to get a collection of a type. The SQL would like this: select * from @tableName where @columnName1 = @columnValue1 The subsonic query would look like this: List<object> = new DB.Select.From<getTypeClass(tableName)>.Where(columnName1).IsEqualTo(columnValue1).ExecuteTypeL...

Subsonic Add or Update methods conversion to Generic Method

So I've got these two methods private static void AddOrUpdate(Computer input) { if (Simple.Repository.Exists<Computer>(o => o.ObjectSid == input.ObjectSid)) { Simple.Repository.Update(input); } else { Simple.Repository.Add(input); } } private static void AddOrUpdate(User input) { if (Simple.R...

Excluding a blob column from active record/linq query results

What's the easiest way to exclude a column from the result set in a Subsonic/ActiveRecord/Linq query? I've a got a table of images, and often I only want the meta data associated with the image (image id/name/dimensions for example). Seems fairly wasteful to be pulling in the entire image data for these requests. My current thought is...

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 ...

Linq problem: The expression of type 'System.String[]' is not a sequence

Hello, I thought I would throw an omni-search on my data. So I made a function that returns any match on a string. ex. var results = (from d in db.MyData where new string[]{ d.DataField1.ToString(), d.DataField2.ToString(), ... }.Contains(searchTerm) select d); But when I try to iterate over it I get The expression of type 'System....