subsonic

Subsonic, setting useSPs=“true” doesn't seem to work. SPs aren't being generated

老子叫甜甜 提交于 2019-12-10 12:09:01
问题 I am using subsonic, I'm reasonably new at it. Today is the first time I need to use stored procedures with it. My provider line in the webconfig is as follows: I am using two providers pointing at two different databases, where the other one isn't calling the SPs. When I generate, I am getting all the tables and the class storedprocedures's but it is empty! So when I do SPs. ... in code there are no classes to display. Does anyone know what's happening here? UPDATE: If I set UseSps="True" on

How do you change SubSonic 3's connection string on the fly?

可紊 提交于 2019-12-10 11:40:29
问题 I want to wrap some queries in a SharedDbConnectionScope and execute them under a different connection string. How do I add a provider/connection string dynamically in order to do this? Thanks 回答1: Both the ActiveRecord\Context.tt and the LinqTemplates\Context.tt that you would use to generate your classes contain constructors: public <#=DatabaseName#>DB(string connectionStringName) { DataProvider = ProviderFactory.GetProvider(connectionStringName); Init(); } public <#=DatabaseName#>DB(string

SubSonic 2.x now supports TVP's - SqlDbType.Structure / DataTables for SQL Server 2008

喜夏-厌秋 提交于 2019-12-10 11:03:38
问题 For those interested, I have now modified the SubSonic 2.x code to recognize and support DataTable parameter types. You can read more about SQL Server 2008 features here: http://download.microsoft.com/download/4/9/0/4906f81b-eb1a-49c3-bb05-ff3bcbb5d5ae/SQL%20SERVER%202008-RDBMS/T-SQL%20Enhancements%20with%20SQL%20Server%202008%20-%20Praveen%20Srivatsav.pdf What this enhancement will now allow you to do is to create a partial StoredProcedures.cs class, with a method that overrides the stored

use subsonic 2.x and 3.x in the same project

别等时光非礼了梦想. 提交于 2019-12-10 06:33:43
问题 Is it possible to mix them? I'm asking because I have a big project that uses Subsonic 2.x generated classes (in a compiled dll) but would like to start using 3.x for new stuff. I tried it last night with a project where I had references to both subsonic.dll and subsonic.core.dll but that didn't work with ambiguous references, etc. So removed 2.x and then got an issue with my older compiled subsonic generated classes in that they needed Subsonic 2.1 to run. 回答1: Hmm... I think there's a small

Issue with Linq Join (subsonic)

[亡魂溺海] 提交于 2019-12-09 01:56:29
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.DealerName, Country = dealer.Country, Email = dealer.Email, Contact = dealer.Contact, Url = dealer.Url, IsActive = dealer.IsActive, IsWholesale = dealer.IsWholesale, Address = address == null ? null : address }; When I execute it (by calling ToArray or whatever), I get this error: System

Sub Sonic not closing connections

ぃ、小莉子 提交于 2019-12-08 12:39:04
问题 I'm using Linq from SubSonic 3 like this: for(int x; x < 100; x++) { var v = (from c in db.categories where c.parent == 10 select c); if (v.Count() > 0) return null; category[] c = v.ToArray(); } for some reason SubSonic is not closing the connections...so after a few runs of the above loop I run out of SQL connections in the pool or MySQL just refuses to allow more connections...I've tried this both with SS 3.0.3 and with SVN, and I keep getting these errors. What should I be doing to close

SubSonic and MS SQL Server Compact - Data Provider

筅森魡賤 提交于 2019-12-08 11:52:49
问题 I developing new application and I would like using SubSonic and SQL Server Compact. But when I run my simple app (for trying SubSonic) I get exception "Unable to find the requested .Net Framework Data Provider. It may not be installed." Anyone have some advice for me, how solve this? I have reference to System.Data.SqlServerCe UPDATE I downloaded SubSonic latest source code and all code about SQL CE is in comments. I uncomment, but I get same exception. DbDataProvider.cs 回答1: EDIT: SQL

SubSonic generated DB Schema, binary types?

强颜欢笑 提交于 2019-12-08 08:54:23
问题 How do you create binary columns in the DB using SubSonic's Schema builder? So tonight I decided to dive into SubSonic. I see a lot of questions on here and great responses by Rob and many others. I see that SubSonic is an ORM, with the T4 Templates it can generate some very nice and efficient classes from an existing database. But, I want to go the other way. I have a very rich Domain, and want to create my tables adhoc from my Domain using SubSonic and the RunMigrations option. All works

Issue with Linq Join (subsonic)

余生长醉 提交于 2019-12-08 08:06:06
问题 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.DealerName, Country = dealer.Country, Email = dealer.Email, Contact = dealer.Contact, Url = dealer.Url, IsActive = dealer.IsActive, IsWholesale = dealer.IsWholesale, Address = address == null ?

Learn SubSonic before NHibernate or Vice Versa?

↘锁芯ラ 提交于 2019-12-08 06:45:55
问题 We've been using our own DAL for our projects in our company and for the passed 2 projects this has causing us problems. Because of this I want to study SubSonic and/or NHibernate. Is it better to study SubSonic first or NHibernate? What are the advantages/disadvantages? From what I have read from related questions here NHibernate is more complex compared to SubSonic so I want to start with the latter. 回答1: SubSonic is significantly easier than NHibernate, you can start working with it almost