subsonic

Sub Sonic not closing connections

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

what is subsonic?

I'm lost here, can someone explain to me what subsonic is? is it a code generator type tool? ...

Support for compact framework in subsonic 3.0?

I was wondering when support for compact framework and sql server compact edition will be added to the Subsonic 3.0 project? ...

Query slow on first run but fast on subsequent calls - Subsonic 2.0

Hi, We've come across an issue when we open our application and run a Subsonic Select the select takes a while to return data. Any subsequent calls to the same select run very quickly. The equivilent T-SQL also runs very quickly. It's as though SubSonic is caching something on the first connection and reusing this on subsequent connecti...

Table specification in the where clause in SubSonic

I'm having a bit of a hassle with something that should be rather straigt forward, so either I'm getting crosseyed (that's actually not unlikely) or there is something strange going on. I'm joining two tables and filtering on the join table, however SubSonic ignores my table specification in the Where statement. If I switch the tables ...

Extract SQL from Subsonic 3

Is there a way to extract the SQL which is run against the database from a bit of subsonic? For instance I have foreach (var item in EVT.All().Where(e => e.EVT_USRNAME == "stimms")) { ... } Can I get at what is run? ...

SubSonic OpenExpression/CloseExpression

Hey All! I'm trying to construct a query that is something like this: Where column = "value" AND column2 = "value" AND (column3 = "value" OR column4 = "value") I have this code: return new Select() .From(LessonChallenge.Schema) .Where(LessonChallenge.ChallengerStatusColumn).IsEqualTo("Finished") ...

SubSonic 3 Linq projecting anonymous types but not class types

I am fairly new to SubSonic 3/Linq, and don't know if I'm missing something obvious, but I think I ran into a projection issue. I am trying to perform the most basic query, and getting back proper results only when I use anonymous types. The moment I swap the anonymous types with regular class types, I get all properties set to null/zero...

Setup with SQL Mirroring

I have a system setup with SQL 2008 database mirroring with automatic fail over. Is anyone using Subsonic with this type of configuration? I notice that when the fail over occurs the database connection is lost but regained when the page is refreshed. Are there any special configuration options for Subsonic to retry the operation x numbe...

SubSonic - calling sproc's w/o parameters?

I noticed something with SubSonic 2.x that I'm sure others have run into... Calling a sproc with results = SPs.SpGetCountryList().GetDataSet(); I kept getting a Null reference exception. To get around this, I added a dummy parameter in my sproc, and called the same function with an irrelevant number - SPs.SpGetCountryList(1).GetDataSe...

Subsonic map POCO to table of a different name

I started a small project and wanted to use Subsonic's SimpleRepository for my database layer. If I have table in my database called Member and I want to create a POCO called TeamMember. Can I map class TeamMember to table Member via an attribute or some other method? It is possible that what I'm asking is not how the SimpleRepositor...

password encryption in users create view

hi thre i want to provide a textbox that would allow the user to encrypt a text i will basically use that in my create view for users and i have username and password textbox html helper how would i apply an encrypt functionality for the password textbox html helper? let say i have a button encrypt beside the password textbox... i ...

Advice on Subsonic Batch Insert Query

hi am running batch insert with subsonic 3.0.0.3 and MVC and i have wrote the following example: var myquery1 = new Insert(provider).Into<orderitem>("orderitem_orderid", "orderitem_productid", "orderitem_qty", "orderitem_total", "orderitem_sessionid", "orderitem_internal", "orderitem_measurement").Values("1", "1", "1...

Check for ModelState errors in posted FormCollection on different Controller

I have a WebPage Controller that handles all my public side of things on the website. I have an Enquiry table to insert details of information typed in a contact form. On the contact page it posts to the WebPage Controller with the contact form information. How do I check that the form collection validates against the expected Enq...

Subsonic query: Problem with the produced query

Hello there, I'm having a problem with subsonic quey. The deal is, I have a View and I want to query it's data to produce something like the following SQL statment: select * from myView where (col1 like '%a%' or col2 like '%a%' or col3 like '%a%') and col4 = 1 and col5 = 2 But instead the query that is submited to the DB is somet...

Subsonic 3 injects the column TestMode on a join

return (from sge in Context.SecurityGroupEmployees join sg in Context.SecurityGroups on sge.SecurityGroupId equals sg.SecurityGroupId join lu in Context.Lookups on sg.SecurityGroupTypeId equals lu.LookupId where lu.Value == value select sge.Employee).ToList(); the above code w...

Subsonic: How to add new properties and populate its data using Linq

I extend the Order Class generated by activerecord: public partial class Order { private string _refCustomer; public string RefCustomer { get { return _refCustomer; } set{_refCustomer =value;} } } Then, I tried to populate Order's data: var info = (from o in db.Orders join...

InnerJoin with Where Expression trouble

I am using Subsonic 2.1 and I need to do an innerjoin and use a where expression and I keep getting the error: Must declare the scalar variable "@Partner" Here is my code: Dim ds As DataSet = UWP.Model.DB.Select("TOP 30 FirstName, LastName, EmailAddress, CustomerRowID, CompanyName") .From("Customer").InnerJoin("Partner") .W...

No datetime values populated from MySQL using SubSonic 3 Linq

I have a MySQL table with a couple of Datetime columns. The columns are set to allow null and some have default value '0000-00-00 00:00:00'. This is a conversion project from ASP to ASP.NET so the table is full of data, and where some rows still have the default value, so I had to set "Allow Zero Datetime=True" in the connectionstring to...

Inserting a Hierarchy with Subsonic 3

I have used the Subsonic3 Linq T4 templates to generate data access code for my database. The one table I have so far represents a class very much like the following. public class NavigationItem { int ID {get;set;} // Auto generated field in database int ParentId {get;set;} // equal to ID if this is a top level navigation string ...