subsonic3

T4 Template issue in web application (VB) (Subsonic)

Hey there, new to SubSonic and Templates. I'm compiling my Web Application using VB.net (I didn't notice anywhere that SubSonic requires C#.net and although I can write c# code I am more versed in VB.NET) and I'm having an issue with the ActiveRecord.tt file. I took the files from the 3.0 download from the "SubSonic_3_0_0_3\SubSonic 3 ...

Subsonic 3.0: Retrieving Primary Key ID after Save()

While I'm new to Subsonic 3.0, I ran into a strange problem. The problem: I can't retrieve new primary ID value after Save(). In recent subsonic versions it was easy, as objects primary key value updated automatically after Save(). But it doesn't seem to hapen with Subsonic 3.0 as it always returns 0 as new primary key ID. Any clues wher...

LINQ Left Join Causes error in SubSonic.Core

I am using the latest version of SubSonic 3 and ActiveRecord. I am trying to do a left join in LINQ. It fails with an error somewhere down in SubSonic. I have a Vehicle object and a VehicleImage object The Vehicle can have multiple images, but it is not required. so a left join is appropriate. This is what I have var ve...

SubSonic 3 doesn't honor schemas for update (fixed)

I am not running Mike's latest code because it does not build and he didn't update the templates to generate code for the new Load with columns he added. So I am one revision back in the source. My database has tables in multiple schemas and they would not update properly. In SubSonic.Query Update.cs I needed to change the constructo...

How to set schema in SubSonic3 Update Query

This SubSonic Update Query: var db = new Edumatic3DB(); var qry = db.Update<MetaDataKeyBooleans>() .Set(x => x.Name == metaDataKeyBoolean.name) .Set(x => x.DefaultValue == metaDataKeyBoolean.defaultValue); if (metaDataKeyStructureId != -1) { qry.Set(x => x.MetaDataKeyStructureId == metaDataKeyStructureId); } qry.Where(x => x...

Subsonic 3 and Parameterized query

I'm evaluating Subsonic and ran into something in SQL Profiler. The issue I'm seeing is when doing a linq query to select a single item by pk, the Profiler shows it not as a parameterized query, and under BatchStarting and BatchCompleted. I did what I think is an identical query using Linq2Sql and got the expected RPC:Completed paramet...

subsonic 3.0.0.3 with mysql can not work in .net 4.0?

hi, i have installed vs2010 beta2, create a MVC website, i want to use subsoinc access a mysql database in SimpleRepository, when run the website, i get error: "Unable to find the requested .Net Framework Data Provider. It may not be installed. ". var repo = new SimpleRepository("NorthwindMySql", SimpleRepositoryOptions.None); var user...

I'm having an issue with compliling database objects in SubSonic 3.0 due to project and connection string location issues.

Hello there, i'm having a issue with the T4 templates for generating code. I'm wondering if anyone can help me with an issue I have. I want to store the connection string for use with SubSonic 3.0 in a default location such as the root of the website (Web.Config or a seperate .config file). This is fine providing the t4 Templates are "...

Subsonic Query Construction for Contains(Guid)

I have a "Notes" table. Notes support one level of threading - in other words you can reply to a note but cannot reply to another reply. So the table looks something like the following: CREATE TABLE [dbo].[Notes] ( [NoteId] [uniqueidentifier] ROWGUIDCOL NOT NULL DEFAULT (newid()) CONSTRAINT [PK__Notes] PRIMARY KEY ([NoteId]), [...

Subsonic support for byte[]?

I have been using the SimpleRepository in Subsonic 3.0.0.3 for several months and I have been very happy with it so far. However I discovered today that it does not support type members of type "byte[]". Apparently, I'm not the only one who has faced this limitation. Is there any technical reason why Subsonic does not support this typ...

SubSonic3 linq problem

I have this query: var rights = from gu in db.GroupUsers join g in db.Groups on gu.GroupId equals g.GroupId join gr in db.GroupRights on g.GroupId equals gr.GroupId join r in db.Rights on gr.RightId equals r.RightId where gu.UserId == userId && g.IsDeleted == false select ...

How to get the table schema dynamically using Subsonic 3.0?

I have a page and it lists bunch of tables in a drop down list. I need to load up a list of columns in the database dynamically. In Subsonic 2.0 it could have been done by Subsonic.Schema.BuildTableSchema but not sure how to do it in 3.0. I tried using the code below but does not work .. SubSonic.Schema.DatabaseTable D = new SubSonic.S...

subsonic 3.0 dynamic search query

Hi , I want to build dynamic search query with subsonic 3.0. who can help me? Any sample Please. ...

Problem In Updating the existing record in subsonic 3.0

private Boolean Saveuser(bool isNew) { tb_User user = new tb_User(); user.User_Name = txtUserName.Text.Trim(); user.User_LoginName = txtLoginName.Text; user.User_Password = txtPassord.Text; user.User_ModifiedBy = clsGlobalVariable.strusername; user.User_Modified = DateTime.Now; user.User_IsDeleted = false; ...

What is the full syntax for calling a stored procedure in SubSonic 3.0?

What is the full syntax for a stored procedure using SubSonic 3.0? Here is my code which is not working: DataSet ds = new DataSet(); StoredProcedure sp = test.Usersp_Stock_Search("", 0, ""); sp.ExecuteDataSet(); ...

Subsonic - Migration from 2.2 to 3.0

Where can I find an examples of code migration from SubsSonic 2.2 to 3.0. For example we have Subssonic 2.2 code: public static void SavePageModules(PageModuleCollection modCol) { modCol.SaveAll(); } How do we write this method for 3.0. Are Collection deprecated in 3.0. Best regards. ...

Why is SubSonic and ActiveRecord throwing an exception when updating a record?

I have the following table in MS SQL Server 2008 Standard Edition: CREATE TABLE [dbo].[NewTestQueue]( [JobID] [int] IDENTITY(1,1) NOT NULL, [ServerName] [varchar](50) NULL, [DomainID] [int] NOT NULL, [Action] [varchar](50) NULL, [Folder] [varchar](150) NULL, [Method] [varchar](50) NULL, [ActionProfile] [varch...

Plans for eager loading for ActiveRecord in Subsonic 3?

Just curious if there are plans for eager loading using ActiveRecord in Subsonic 3. Is there a roadmap out there? It seems like a pretty sweet library. Very similar to Rails but missing a few sweet spots. ...

Subsonic 3.0 and "Link" tables.

I have the following set-up. BlogPosts BlogToCategory Category One blog post can have many categorys and a category can be in many blog posts. (Hence the intermediate table. How would I go about getting a list of all the blog-posts in one category. I've tried this but cant seem to get it right (I get a IQueryable -> IEnumerable cast...

SubSonic 3. Get results as DataTable

How can I get .All() method's result as a DataTable ? Currently it returns IQueryable, wich can't be used as datasource for the WinForms DataGridView control. dataGridView1.DataSource = Product.All(); // not working ...