subsonic

Deleting from a subsonic collection bound to a winforms datagridview

I have a winforms application that i added a DataGridView bound to a subsonic collection via a BindingSource to it. The grid works fine for adding/editing (except for the display of the ComboBox column) but i can't get it to delete rows correctly from the database. If i delete a row from the DataGridView, i can't problematically determ...

Using SubSonic2.2

Hi, I just download the SubSonic2.2 and use it but many of my prev codes ( Insert in tables when I have an Identity or unique field) throw errors ,also scraffold component can't insert in this tables. I saw the SubSonic version in SubCommander is 2.1 and maybe this make problem, I can't find any other version that has SubSonic2.2. While...

SubSonic, Scaffold error

Hi, I use Scaffold for manage my tables data, using subsonic 2.1. just for one table I got this error message when try to view table data, i recreate related classes several times but still and just for scaffold I got this error, I can use table class and insert / edit data myself. In my table I have both nvarchar and bigint fields. What...

simple query with brackets - how to build?

I'm trying to build a query to use for a search engine, that would look like this one: SELECT * FROM sometable WHERE col1 = 1 AND col2 = 2 AND (col3a = 3 OR col3b = 3 OR col3c = 3) I though the code below would work: SubSonic.Query query = new SubSonic.Query("sometable"); query = query.WHERE("col1", 1); query = query.WHERE("col2...

Is there deep loading in subsonic?

Hi, I am new in subsonic, and can't find the way to load data whith it's parents or childs data in one query. Is it possible in subsonic? ...

Create A WPF ObservableCollection From A SubSonic 2.2 Collection

If I have a DAL created by SubSonic 2.2, how do I convert the Collections created by it to WPF ObservableCollections in code (pref.VB.NET) to be consumed by WPF? TIA, Kevin ...

Delete all records from a table

How can I delete all records from a table using SubSonic? The Delete method has three overloads, but each one expects some parameters. And how can I delete records using a query (e.g. delete all records where column1 > 100) ...

Error when the Stored procedure don't have any parameters

Hi I am trying to call the stored procedure using subsonic and getting Object Reference not set. It is working for othe procedure only fails if the procedure don't have any parameters. Is this known error? any fix? Thanks (I am using the latest version) ...

Using SubSonic in VB.Net web application

Hello, I am using Subonic in a VB.net application for the first time (I have used it succesfully in a WebSite project plenty of times). I followed the 2nd part of the 'Getting Started' video to actually generate the DAL source files as opposed to the build provider method and everything APPEARS to have gone like expected. However, no...

Use the Subsonic.Select() ExecuteTypedList Method with String

This is more a question regarding generics than subsonic: Imagine if have the following code: List<int> result = DB.Select(Product.Columns.Id) .From<Product>() .ExecuteTypedList<int>(); That works great and returns a generic list with the ids from my Product table. But if I want to get a list of the Produc...

SubCommander and VS2008 - DAL not found

I have VS2005 and VS2008 Side by side (I just installed VS2008). When I run SubCommander in VS2005, everything works perfectly. However, when I run it in VS2008, my generated classes are not found in the IDE. Is there a configuration change, or something I'm missing? Thanks, ...

Subsonic 3 T4 Templates - Output half of a View to a UserControl

I am using the Subsonic MVC Template and in the List.tt template it loops through all the properties and puts them into an HTML table. I would like that table written to a usercontrol but after a few hours I cannot get it to work properly. The T4 templates can be found here http://code.google.com/p/subsonicproject/downloads/list. ...

SubSonic Multiple column primary key

Hi, we have certain tables where we have multiple columns which together make the primary key. When SubSonic generates all it's classes for our tables for the tables with multiple columns there are still methods, like FetchByID, that only use one value for the primary key. Because of this the foreign key property will return the wrong i...

SubSonic CreatedBy

I have a CreatedBy column in a table which datatype is a int. SubSonic crashes on this because apperently it uses CreatedBy, CreatedOn, ModifiedBy and ModifiedOn. The By columns need to be strings. Is there a way to let SubSonic know that it has to ignore these columns? ...

Subsonic - Bit operation in Where Clause

I'm trying to make something like this: int count = new Select().From(tblSchema).Where("Type & 1").IsEqualTo("1").GetRecordCount(); And the error message is: Incorrect syntax near '&'. Must declare the scalar variable "@Deleted". Is it possible to do that with SubSonic? ...

Custom where clause with a string?

I'm returning a dataset using SubSonic.SqlQuery of two joined objects, but I can't seem to figure out how to perform this where clause: Month(SubmittedOn)=Month(GETDATE()) AND Year(SubmittedOn)=Year(GETDATE()) I tried to do it like this, but it did not like the .IsEqualTo(string): .Where("Month(SubmittedOn)").IsEqualTo("Month(getdate...

Perform single selection with where

I'd like to achieve the following SQL statement with subsonic 2.2 SELECT Product.* FROM Product WHERE Product.OurPrice <> Product.RetailPrice The Subsonic select query I've started with: SubSonic.SqlQuery select = new SubSonic.Select() .From<Product>() .Where(Product.Columns.OurPrice) .IsNotEqualTo(... object /*Should be Product.Co...

Best way to query a database using an OR statement

I am attemping to create the following sql script into a subsonic query that I can use with a collection: Select * from tableA where tableA.InvoiceID = @Invoice and tableA.VersionID = @VersionID and tableA.ActiveDate >= GetDate() and (tableB.InActiveDate is null or tableB.InActiveDate <= GetDate()) Here is my current code: orders = n...

SubSonic Schema Errors

Hi, I am running VS2008 in .net 3.5 and trying to get SubSonic 2.2 running. My database is called Test, the table in the DB is called TestTable. It is being run on SQL Server 2005. I get the following "warnings": Could not find schema information for the element 'SubSonicService'. Could not find schema information for the attrib...

Generating Db Versions

Hi, I am trying to generate dbVersion using SubSonic but When I execute the following Command C:\Program Files (x86)\SubSonic\SubSonic 2.1 Final\SubCommander\sonic.exe version /out Generated\dbVersions\ I receive the following Error. Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=ne...