subsonic

Subsonic 3 and Activerecord isn't generating MySQL Stored Procedures

It seems that the included T4 templates (or the one in the SVN trunk for that matter) just skips generating SPs for MySQL... When running StoredProcedures.ttinclude together with MySQL.ttinclude, I get the error "Compiling transformation: The name 'GetSPs' does not exist in the current context". GetSPs is defined for SQLServer and I saw...

Subsonic 3 - Update NullReferenceException

I am using Subsonic v3.0.0.3 with the Linq templates. I am attempting to update a record in a SQL Server Express database with the following: var db = new MyDB(Constants.Database); db.Update<Contact>() .Set(d => d.FirstName == contact.FirstName) .Where(d => d.Id == contact.Id) .Execute(); I am receiving a NullReferenceException ...

SubSonic Select Sum 3 Columns

Hi, i need following SQL Expression for SubSonic I have to SUM 3 Columns and return the value in my result. SubSonic.SqlQuery qs =new SubSonic.Select() .From(Table.ViewAllratingsGlo.Schema.TableName); SubSonic.Aggregate ag = SubSonic.Aggregate.Sum(("Column1+Column2+Column3), "Score"); qs.Aggregates.Add(ag); string SqlResult = qs.Buil...

Subsonic BatchQuery.Queue causing 'Can't decide which property to consider the key...' exception

I'm just getting started with Subsonic 3.0 ActiveRecord and am trying to implement a batch query like the one in the SubSonic docs. I'm using a batch so I can query a User and a list of the users Orders in one shot. When I call the BatchQuery.Queue() method, adding my "select user" query, SubSonic throws the following exception: System...

SubSonic 3 and multiple PK columns

I'm having problem with SubSonic 3 and multiple Primary Key columns. It seems like it isn't supported via the ActiveRecord T4 script. In line 173 of Settings.ttinclude return this.Columns.SingleOrDefault(x=>x.IsPK) ?? this.Columns[0]; It tries to get a Single Primary Key Column and failed. Any solutions? ...

Why am I getting arbirary exceptions when using Subsonic 3

I have a few questions regarding Subsonic 3: Does anyone use it in their projects? Why do I keep on getting primary key exceptions when accessing tables? Why do I seem to be getting arbitrary null reference exceptions when using subsonic? ...

"Lambda Parameter not in scope" exception using SimpleRepository's Single method

Hello, I'm attempting to use the SimpleRepository to perform a fetch based on a non-ID property. Here's the Customer class I'm using: [Serializable] public class Customer : IEntity<Guid> { public Guid ProviderUserKey { get; set; } public Guid ID { get; set; } } I'm using Si...

SubSonic 2.2: DefaultConnectionString

I may be a bit over my head here - but hopefully someone can point me in the right direction. Using the latest SOURCE files for SubSonic 2 - I need to be able to manipulate the CONNECTIONSTRING for specific requests based on the USER. I thought I could modify DefaultConnectionString is DataProvider.cs - but HttpContext.Current ALWAYS s...

No value is returned for an NVARCHAR column

I'm trying to use SubSonic 3.0 with SQLite 3 in ASP.NET MVC. After initial pains of setting it up I am finally able to retrieve data from my single (so far) table database, however I never get a value for the Testimonial column. I tried renaming it to something like TestimonialText, I tried changing its data type to VARCHAR, NVARCHAR wit...

SubSonic generate incorrect SQL when using Group By or Distinct with Paging

I am just wondering anyone else run into this problem. SubSonic generate incorrect SQL when using Group By or Distinct with Paging. Is this known error ? any fix ? Any help would be greatly appreciated. Thanks Notice the group by is in the wrong place when use paging. SubSonic SQL output Without Paging: exec sp_executesql N'SELECT [...

Subsonic 3 equivalent of Subsonic 2 SetColumnValue and GetColumnValue ActiveRecord

I am converting a project from Subsonic Version 2.2 to 3.0.0.3 and have been unable to find the equivalent functionality of SetColumnValue and GetColumnValue in version 2. Any help appreciated. LK ...

SubSonic 3.0.0.3 | SimpleRepository | DB DataType - Class DataType mapping

I am beginning to make friends with SubSonic 3.0.0.3 - SimpleRepository. Since you/I have to create every object class, so I made a simple code below, just to save some time. My only question is, does my mapping are correct (DB DataType to .Net DataType)? Here's the simple code: public string CreateClassEntity(string ConnectionSring, ...

SubSonic 3.0.0.2 Structs.tt

The error I'm getting seems to be coming out of the Structs.tt file. I'm using the Northwind db and only using the Products table (I excluded all other tables). I return Json(Product.All()). Here's the error: A circular reference was detected while serializing an object of type 'SubSonic.Schema.DatabaseColumn'.Here's the Stack Trace: ...

Subsonic 2: object brings back multiple database tables info

hi i ask subsonic for a table in my database it returs the table and all other tables connected threw foreign keys, cant i stop it bringing back all the extra table info?? here is my code: [WebMethod] [ScriptMethod] public List<DealEquipment> GetDealEquipment(Guid DealID) { List<DealEquipment> dealEquipmentList = new List<DealEqu...

Subsonic 3 - how do you execute a stored procedure that returns a value?

How do you execute a stored procedure in subsonic 3.0 that returns a value? For example many of my stored procedures return @@identity, and I can't figure out how to access that value without re querying the table. Again, not an output parameter, but a return value. ...

Return ForeignKeys in SubSonic.Query

I have a table that possesses ForeignKeys In this code below that am using only the columns of the table informed in the parameter is return public DataSet Store_RefreshData(string Table){ Query q = new Query(Table); return q.ExecuteDataSet(); } Precise to come back a field "descricao" of the related table using a Sub...

combobox in datagrid view showing Value Member

I have a datagridview with several columns, one of which is a combobox. When I click off the combo box the Display member changes to the Value member. My guess is that this is somehow do to info in the data table that I bind to the datagridview. I'm using subsonic to create the table. Anyone else have something similar happen? ...

SubSonic 3.0.0.3 Calling Stored Procedure Issue

Hi, I have updated the subsonic reference from 3.0.0.0 to 3.0.0.3, when I try to execute a stored procedure then I get a following error Implicit conversion from data type sql_variant to varchar is not allowed. Use the CONVERT function to run this query. I am calling the store procedure as follows db.GetAllLoanApplications(orderBy, ...

SubSonic 2.2 Installation Instructions?

Just wondering if anyone can point me in the directions for the SubSonic 2.2 installation instructions? ...

Subsonic 3 Simple Query inner join sql syntax

I want to perform a simple join on two tables (BusinessUnit and UserBusinessUnit), so I can get a list of all BusinessUnits allocated to a given user. The first attempt works, but there's no override of Select which allows me to restrict the columns returned (I get all columns from both tables): var db = new KensDB(); SqlQuery query = ...