subsonic

SubSonic 3: Unit Tests were working but now it cannot find the connection string

I had set up a bunch of NUnit unit tests using the Test connection string in my App.config file and everything was working fine. Then all of a sudden all my tests stopped working and threw the same exception: System.ApplicationException : Connection string 'ApplicationServices' does not exist Yet here are the contents of my Ap...

Sub Sonic 2.2 cache? problem

I recently started playing around with SubSonic 2.2 (only 2.2 because I didn't find any Oracle t4 templates at the time). That aside, I have been noticing that I can run a query on table a and field b will have a value of 1. If I went into Sql Tools or Oracle Developer and changed field b to a value of 2, SubSonic's LoadByKey functions...

Subsonic 3: Update<T> problem

I am using SS 3.0.0.3 ActiveRecord. This query: new Update<BillDetail>(provider) .Set(bd => bd.DivisionDetails == divisionDetails) .Where(bd => bd.BillNumber == documentId && bd.IsInvoice == true); produces this SQL: UPDATE `BillDetails` SET `DivisionDetails`=@up_DivisionDetails WHERE `BillNumber` = @0 Where did the IsIn...

Using Subsonic 2.2 on Windows Mobile 5 with SQL Server CE 3.5

I have seen comments stating that Subsonic currently does nt support MS SQL Server CE (http://stackoverflow.com/questions/1130863/subsonic-and-ms-sql-server-compact-data-provider). The link provided is for Subsonic 3. So my question is, does Subsonic 2.2 support MS SQL Server CE? And if so, is there any documentation on how to use sonic...

How to use SubSonic Transaction with Parent Child Tables

I have 2 tables (For simplicity many field where removed) tblOrder - OrderId - OrderDate - UserId tblOrderDetail - OrderDetailId - OrderId - ProductId - Qantity I go ahead and create my object and I want to save everything in memory in one transaction because if something fail in the order details, I don't want the order to be saved....

please help cant get my head around multiple models in one view

i have tried till my head hurts and have been reading so much my eyes now bleed. i have a controller, and i want to get one set of data for the order and one list for the order items. i have created a order class and a order items class, and trying to get it so that the order will have a list of order items but it is crashing my brain ...

LeftOuterJoin with same table - don't know how to distinguish them

Hi, I would like to make a LeftOuterJoin between one table and same table, but dont know how to make the distinguish them... SubSonic.SqlQuery q = new Select(). From(TABLE.Schema). LeftOuterJoin<TABLE>(); This returns me the error: The objects "dbo.TABLE" and "dbo.TABLE" in the FROM clause have the same exposed names....

Parent and Child object in SimpleRepository

How would it work in Subsonic's SimpleReporitory if I wanted to be able to have a 1 to many relationship between objects? Would I have to create a bridge object and then build my parent object at runtime, or is this support built in? What I am looking for is the folowing: Adam's Example Shop... Public Class Shop Private m_id As...

Subsonic and gridview control delete

Does anyone know how to use the gridview delete functionality with Subsonic 3? I am trying to delete rows that do not have the primary key displayed in the the gridview so I can't just pull that data from the gridview row. I was wondering if there is a way to do it with the DataKeyNames property. Thanks.. ...

Can't insert from subsonic 2.2 to mysql (Joomla CMS database)

I can't insert record into mysql database (joomla CMS table jos_content). Receive: Exception:"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use Any idea, what could be wrong, since I'm just copying all data except autoincremental from source record (same dat...

how to use subsonic2.1 build a query like this

SELECT * FROM sometable where a=1 and (a=2 or (b=1 and c=2)) How can I build a query I need? (no inlinequery) ...

How flexible is subsonic

I currently use nhibernate but a guy at work has recently gotten me interested in subsonic again. I really prefer a Poco, domain-driven style approach to development and worry about the database later. It looks like this is partially supported using simplerepository. My question is, how flexible is subsonic in how it generates your da...

Add additional namespace to SubSonic 2.2 generated files

I think it should be possible to add additional namespaces to the generated classes without modifing SubSonic's core or the CS_ClassTemplate.aspx, but instead with a SubSonic config parameter. But atm I can't find any example. Does anyone know how this config option (if any) is called? ...

subsonic 3 | can't T.save(DataProvider ) |DataProvider is not Default|ActiveRecord

HI: I have 2 Structure of the same DataBase,used ActiveRecord IDataProvider db= SubSonic.DataProviders.ProviderFactory.GetProvide(connectionStringName); db is not default IDataProvider. When "T.Save(db);" Throw Exception . Message: typeof(T).name+"s" of no avail When I change to default DataProvide. T.save(); That's OK!! sub...

LINQ and VB.NET and the expression tree that is compiled is breaking SubSonic 3

I've been trying to solve a little problem with VB.NET and the expression trees it likes to generate. I have a simple test... Public Sub ActiveRecord_Find_By_NonKey_Returns_123() Dim orders = Order.Find(Function(item As Order) item.EmployeeID = 1) Assert.Equal(Of Integer)(123, orders.Count) End Sub One would expect that to wor...

SubSonic 3.0 Simple Repository Adding a DateTime Property To An Object

I am trying out SubSonic to see if it is viable to use on production projects. I seem to have stumbled upon an issue whith regards to updating the database with default values (String and DateTime) when a new column is created. If a new property of DateTime or String is added to an object. public class Bug { public int BugId { get;...

Foreign keys and one-many relationships with subsonic simple repository

Hi, I'm using the SimpleRepository in SubSonic 3.0.0.3, and have created the classical example with an order, which contains a collection of order lines: public class Order { ... public IList OrderLines { get; set; } ... } However, when saving this one trough the repository (using migrations), the OrderLines property is ignored. Is i...

SubSonic 3 auto migrations in a live environment.

I'm looking at using SubSonic 3 as my preferred OR mapper on a new project and have a question that I can't seem to find an answer to... I'm looking to use the SimpleRepository approach, and I've noticed that I can specify a "SimpleRepositoryOption" parameter which appears to be a hint to SubSonic as to whether it should cascade schema...

Using SubSonic Active Record in a seperate assembly from the Web

I'm following the tutorial here. I created a new Web Application. I then added two Class Library projects, Common and Domain. The common project contains the SubSonic library while the Domain project contains the SubSonic .tt and .ttinclude files. After modifying the settings in Settings.ttinclude, I try to 'Run custom tool' on the tt...

Insert record with Subsonic 3.0

Hi! I have an issue with subsonic. I'm trying to insert a record into table with primary key set to identity with autoincrement. I've got an exception: Cannot insert explicit value for identity column in table 'Zaposleni' when IDENTITY_INSERT is set to OFF. How do I do this? Please, can anybody provide me an example? I should mention...