subsonic3

Subconic3.0 with winform app

Can subsonic 3.0 be used with a winform app? Do I need to add any references to the system.web? If it can be done, how can I exclude certain tables in the DB? Can I use the following whih I am using for subsonic 2.0 <providers> <!--<clear/>--> <add name="TEST" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="myString...

The constant for Guid is not supported

Using SubSonic and linq-to-sql, I want to join two tables, but under a little bit different circumstances, based on runtime conditions. The tables are PriceListItem and CatalogItem. I have defined a struct, JoinedItem, that has one member for a data object from each table. struct JoinedItem { public PriceListItem pli; ...

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

Uppercasing first letter of table name causes insert issues with SubSonic3 on Save

Hey guys, SubSonic 3.0.0.3 with MySQL 5.1 and the .NET Connector. In my Settings.ttinclude file, I had this code: string CleanUp(string tableName){ string result=tableName; //strip blanks result=result.Replace(" ",""); //strip the phrase "tbl_" and "view_" result=result.Replace("tbl_",""); result=re...

App won't compile, getting errors for each table

Hi there, I am trying to build an application using subsonic 3.0.0.3, VS 2008, sql server 2005. I followed all the steps as in the demos / tutorial, and I was able to generated the classes, but the app won't build. Basically for each table mapped, I get the following warning : Warning 3 'GanagroLite.Data.Employee' overrides Object.Equal...

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 ActiveRecord and SQL Server Express

I am trying out Subsonic ActiveRecord to determine if I want to use it on any upcoming projects, and I gotta say I really like it so far. It worked great with MS SQL Server 2005 and 2008, but I am having problems with the T4 Templates and SQL Server Express. From what I can tell, Subsonic is having a problem getting the schema info from ...

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 3 Visual Studio Add-in

I'm look for a subsonic 3.0 Add-in tools for visual studio like what was provided for Subsonic 2. Any alternative tools. I find using the T4 templates annoying. thanks. ...

Subsonic Active Record Execute Direct SQL

How can I execute direct/raw SQL through subsonic 3.0 when using the Active Record pattern? ...

IsDeleted is not working in SubSonic 3.0

Hello, I'm using SubSonic 3.0 with SqlServer and for some reason the IsDeleted field is not being autopopulated to false. It remains null. Is there a quick fix for this in the templates? My field schema is IsDeleted bit null ...

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

How to page data in SubSonic 3?

Whats the best way to page data in SubSonic 3 when you need to apply sort and filter? This is what i came to: (Korisnik is User) var list = String.IsNullOrWhiteSpace(Filter)?Korisnik.All(): Korisnik.All().Where( x => x.Username.Contains(Filter) ); IOrderedQueryable<Korisnik> ordered = list.OrderBy( x => x.Username ); if (Sort == "Userna...

What do I need to subclass Migration?

I'm following the Migration video posted at http://subsonicproject.com/docs/Using_SimpleRepository I've downloaded the latest SubSonic (3.0.0.4), and extracted/referenced the SubSonic.Core.dll in my empty Console Application project in VS 2010. I've created a 001_Init.cs file in the Migrations folder: using System; using System.Collec...

SubSonic 3.0 translate dates to UTC

Is there a way in subsonic 3.0.0.4 using the ActiveRecord scheme to automatically translate dates to and from UTC so that my database will have dates in UTC, but the users will see local time? I've read about a 'useUtc' config option, but it looks like this doesn't exist in version 3. What is the best way to do this in version 3? ...

SimpleRepository migrations when adding foreign keys

Hi I am trying to evaluate SubSonic using SimpleRepository, I have come across a problem with the auto migrations however and I am wondering what the suggested solution is. Lets say we have a table called something like public class Member { [ScaffoldColumn(false)] public Guid ID { get; set; } public string FirstName { get; ...