subsonic

Subsonic Deeploads: Is This Supported?

It could very well be that I'm just missing the correct vernacular in this space, but I'm looking for a particular piece of functionality in SubSonic. In NetTiers it was called a "DeepLoad". A deep load runs to the database and fetches many objects (ie. fetch this OrderDetail and all of it's LineItems) in one database call. Again, I wan...

How do I write this code using SubSonic?

I have some legacy code that I'm rewriting using SubSonic to help the future maintainers. For the most part it's been relatively simple, as everything makes a stored procedure call. But now I'm having some difficulty with some tightly-coupled ADO.NET code. The code depends on the SqlDataAdapter to decide when to call an INSERT or UPDATE...

Outer join with AndExpression

Is it possible in SubSonic to make a query like this SELECT * FROM [customer] LEFT OUTER JOIN [orders] ON [customer].[customerid] = [orders].[customerid] AND [orders].[deptid] = 2 I tried this in with the following SubSonic (2.1) code : SqlQuery q = DB.Select().From<Customer>() .LeftOuterJoin(orders.customerid, customer.custom...

How to check for null values?

I have an integer column that may have a number or nothing assigned to it (i.e. null in the database). How can I check if it is null or not? I have tried if(data.ColumnName == null) { ... } This doesn't work either (as SubSonic does not use nullable types (when applicable) for ActiveRecord) if(data.ColumnName.HasValue) { ......

Filterable DataGrid with SubSonic

My goal is to create a DataGrid that uses a SubSonic object as its data source. The grid should have database-side paging and sorting, as well as columns that are intelligently filterable based on the data type of that column. I actually have a fairly advanced prototype of the grid that does basically what it needs to. The problem is th...

How to check Database connection fast?

In my win app - I want to display an information (or db icon) if the database server is not reachable. But i dont want to wait the 30sec timeout. The user can configure server, user, pw in my options dialog. So, is there a way in subsonic to check very fast if an db connection works? ...

Subsonic - Simple Query

Hi I have a table has 2 columns Val1 int Val2 int My query very simple. I want to get collection of record have condition (val1=Val2) , equivalent to (Select * from table where Val1=Val2) I try IDataReader rdr = new Query("Table").WHERE("Val1=Val2").ExecuteReader(); tableColl.LoadAndCloseReader(rdr); rdr.Close();...

Where to download Subsonic 2.2 Sourcecode without svn client?

Checkout with svn does not work in my environment. Im looking for the sourcecode of Subsonic 2.2 as zip file for example.. ...

Subsonic 2.2 Generated Property for SQL Server 2008 Date

Im using latest SVN 2.2 build compiled with VS 2008. When I build my VB classes using Sonic.exe any columns of type Date (Not Datetime) are generated as "System.String". Has anybody else found this problem and have a solution or is this a problem with Subsonic? ...

How to get multiple rows in subsonic

Hi, I am using the following Product objProduct = new Product("active_flag","true"); This one will result multiple row, how can I access the multple rows? ObjProduct will have only one row? ...

Extending SubSonic Generator

Is it possible to extend the SubSonic generator without modifying it's code? I would like to add my own custom methods that i can use inside the templates. Somthing similair like the Utility.GetVariableType method. ...

SubSonic ASP.NET MVC sample in Visual Web Developer Express

In Visual Web Developer Express 2008 the SubSonic ASP.NET MVC template doesn't seem to work with a new database I added. I removed the Chinook Database and created my own one. I understand the the .tt files in the Models folder are used to generate code, but they don't (despite changing the ConnectionStringName to what I set in the web.c...

Using Insert throws Exception on Datetime field

When trying to execute an Insert comment using the Insert CLass I get the following Exception: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. I am uing the following globalization settings: <globalization uiCulture="en-AU" culture="en-AU"/> And my date format is :"dd/mm/YYYY" ...

SubSonic 2.2 Not Fully Update For VB?

An answer to a recent question on extending SubSonic pointed to a googlecode directory listing the relevant ActiveRecord templates. I was very surprised to see that most of the CS_ ones are a lot newer than the VB_ equivalents. Does this mean that SS2.2 has not been fully updated for VB? ...

how to make subonic convert a String to my custom Type

I tried to search for it on google but couldn't find the answer so i'll try it here. I am using Subonic and am trying to fill an object by using: Model.Object o = new Select() .From<Object>() .Where("Id") .IsEqualTo(id) .ExecuteSingle<Model.Object>(); When doing so i get the error: Objec...

Build Error: 'System.Array' does not contain a definition for 'Columns', ...

I am using SubSonic 2.1 for my web application. It's been working fine until recently I added a table in my SQL Server 2005 database to store user files (such as MS Word, PDF, Jpeg, Gif, Tiff files). The files are stored in a column called ReportFile varbinary(max). After SubSonic generates the code, I build it, and get this error: '...

SubSonic: What if something changes?

Hello, I am using SS 2.1 and just starting out with it. I got everything loaded and it works for the simple tests I've been doing, but a general question: Is there a way to update my build without having to rebuild the entire thing, an example would be if we change the layout of a table. Lets say we have a id, and name, and then later ...

Hierarchical Database Driven Menu in MVC

I use the code below as an HTMLHelper which gets data from the database and loops over it to display a menu. This is fairly straightforward as you can see however, what if you have a database table using the adjacent model of heirarchies eg/ID, ParentID, OrderID. Easy to see whats going on but recursion is needed to get this data out pr...

ASP.NET Search on multiple parameters

I am trying to display the results of a search on a gridview. I want the search to show the results for both last and first name. I am using ASP.NET with Subsonic and can't figure out how to modify the statemnt below. I am guessing it needs a wildcard somewhere? Name: <asp:TextBox ID="txtSearchName" runat="server"></asp:TextBox> G...

Subsonic3 & GUIDs

I have a table with a PrimaryKey that is set as uniqueidentifier (GUID) and it's autopopulated using the newsequentialid() function from sql server 2008... When I insert a row manually, everything works as normal. But when I insert the record using the subsonic class and the repository the GUID column defaults to all zero's and the dat...