subsonic2.2

How can i tell SubSonic 2 to use a different .config file?

风流意气都作罢 提交于 2019-12-25 08:41:06
问题 I'm using SubSonic 2 from within a project and I'd like to specify a different .config file from the default App.config. How can I tell SubSonic to use a specific config file? 回答1: You can't - SubSonic works from Provider settings that are set for the executing environment. You could, if you wanted, use a connectionStrings.config and put that somewhere else, but SubSonic uses ConfigurationManager to open up the app's config and find it's goodies. 回答2: It appears that you can do this by

Locking problems with sqlite and SubSonic when using transactions on a single thread

a 夏天 提交于 2019-12-23 01:19:06
问题 I'm getting locking exceptions when trying to use transactions with SubSonic and SQLite. I'm using this from a single thread and there are no other processes accessing my db, so I really didn't expect any such problems. If I write code like this below, I get an exception on the second call to Save() within the loop - so the third call to Save() over all. using (TransactionScope ts = new TransactionScope()) { using (SharedDbConnectionScope sharedConnectinScope = new SharedDbConnectionScope())

c# subsonic 2.2 : many-to-many relationship and pagination problem

只谈情不闲聊 提交于 2019-12-13 03:55:21
问题 i have 3 tables (Categories, Articles and ArticleCategories). The ArticleCategories has a combined PK and concists of: ArticleID (PK, FK, int) CategoryID (PK, FK, int) Now when I'm using the subsonic paging methods I'm running into some very strange behaviour. It returns double the amount of records then I expect (the 2 PK's?). The issue is resolved by either removing the paging completely or by adding a PK field called ArticleCategoryID. SubSonic.Query qry = new SubSonic.Query(DAL

Update a primary key value using SubSonic 2.2

女生的网名这么多〃 提交于 2019-12-11 05:29:21
问题 I'm currently developing an app using SubSonic 2.2 and I'm having problems updating one of the columns of a composite PK on a table. My code is roughly this: foreach (pageItem page in pages) { page.IdFile = newIdFile; page.PageNumber = counter; counter++; page.Save(); } This does not update my record. My pageItem table contains 4 columns that make up the PK. I only need to update one of them to simulate that I'm moving a page object from one file to another, to avoid creating a new record

SubSonic2.2 SharedDbConnectionScope and TransactionScope Transaction Confusion

蹲街弑〆低调 提交于 2019-12-07 16:18:37
问题 ARGH!!! There seems to be a little confusion surrounding the SharedDbConnectionScope and TransactionScope objects to enable wrapping your SubSonic queries within a transaction. The docs suggest specifying the using SharedDbConnectionScope wrapped around the using TransactionScope... using(SharedDbConnectionScope scope = new SharedDbConnectionScope()) { using(TransactionScope ts = new TransactionScope()) { // do something ts.Complete(); } } Then other question here such as Subsonic: Using

Accessing stored procedures with robconery / massive?

一世执手 提交于 2019-12-07 02:20:12
问题 Another great article by Rob on the Massive ORM. What I haven't been able to find is references on how to access stored procedures. SubSonic had some issues with the overhead of using ActiveRecords, so I preferred to do data access with stored procedures, still using the SubSonic ORM. What I haven't yet seen is outright support for things like SQL Server's TVP's in an ORM, so I modified SubSonic (shameless plug) to support them. Is it possible to access SQL Server sprocs with Massive.

SubSonic2.2 SharedDbConnectionScope and TransactionScope Transaction Confusion

这一生的挚爱 提交于 2019-12-05 23:51:04
ARGH!!! There seems to be a little confusion surrounding the SharedDbConnectionScope and TransactionScope objects to enable wrapping your SubSonic queries within a transaction. The docs suggest specifying the using SharedDbConnectionScope wrapped around the using TransactionScope... using(SharedDbConnectionScope scope = new SharedDbConnectionScope()) { using(TransactionScope ts = new TransactionScope()) { // do something ts.Complete(); } } Then other question here such as Subsonic: Using SharedDbConnectionScope together with TransactionScope seems to be broken suggest the docs are wrong and