subsonic

Can I create an SQL database from Subsonic (reverse) ?

Hi, I had just lost my database and all the backups, I know it is pathetic at the first place but again .. bad things do happen :). Now I have a complete source code generated by SubSonic against my database. I was wondering is there a way I can recreate my database using Subsonic ?? ...

SubSonic reading joined tables cost

Assuming I have the following schema table A: ID int primary key value varchar(255) not null table B: ID int primary key AID foreign key refences A (ID) name varchar(40) not null now when I execute the following subsonic linq var items = from a in A.All() where any-condition select a; all is fine. the killer is when I do the fo...

How to get random list of rows using subsonic 3

hello I am using Active record pattern of SubSonic 3 version. My requirement is to get 3 random rows from the Table. After some googling I found out that I can use NewID function in SQL but I dont know to get the Randow rows using sub sonic Thanks ...

Subsonic 3 not generating classes

I followed the 3 step procedure 20 times on 3 different sytems under all possible conditions and no matter what i do it won't generate the classes. I keep getting the following error. Loading the include file 'SQLServer.ttinclude' returned a null or empty string. The transformation will not be run. ANY Idea's? Frustrated!!!!!!!!!!!!...

How can I obtain the database schema from an existing ActiveRecord.cs file?

I have been given the source code for an existing project that uses SubSonic ORM. My (limited!) understanding is that SubSonic generates code by reverse-engineering the existing database. Unfortunately I don't have the database that was used for this project. I do have the ActiveRecord.cs file from the last time it was compiled. How cou...

Subsonic not returning all rows from a view

I am trying to query a VIEW using Subsonic (2.5). The coding works, but Subsonic ONLY returns data if the result has more than 1 row. E,g, is the query produces 2 records the datatable returned will have 2 records. If the query produces 1 row, that datatable will have 0 records in it?! I've checked the view, and the problem is not there....

Selecting from a View in Subsonic causes an error!

Hello! Sorry if this seems a silly questions but can you select from a view in subsonic? I have a view called fixturesinfo and I am running this subsonic query: FixturesInfoCollection fixtures = new SubSonic.Select().From<FixturesInfo>() .Where(FixturesInfo.Columns.FixtureDate).IsGreaterThan(DateTime.Now.AddMonths(-3)...

When generating SubSonic DAL, is it possible to have .gen.cs in the generated filenames?

When generating my DAL files with SubSonic, I'd like the names of the files to be .gen.cs. The main reason for this is that the files are partial classes, and I would like to add some additional implementation details into another source file for the table called .cs. This is somewhat the standard pattern for generated source files , ...

Forcing subsonic to ignore a certain pattern of column names

We use SubSonic as an ORM of sorts(really more of a query-helper). For one reason or another, we have a bit of a dynamic schema and as such certain tables have generated column names and such. Well, this has been all fine and dandy until now. Now, our production generated columns don't match up with our development generated columns. The...

Subsonic, setting useSPs="true" doesn't seem to work. SPs aren't being generated.

Hello I am using subsonic, I'm reasonably new at it. Today is the first time I need to use stored procedures with it. My provider line in the webconfig is as follows: I am using two providers pointing at two different databases, where the other one isn't calling the SPs. When I generate, I am getting all the tables and the class st...

Linq and SubSonic - returning nested complex types

Hi all, I'm new to SubSonic and reasonably new to LINQ as well, so I'm just trying to put a little app together. I've got the templates all sorted and running okay, but I've run into a bit of trouble with this LINQ statement (simplified slightly, the real statement has some other joins but they don't affect this particular problem so I'...

is there any way to stream binary content with javascript

I am hoping to make an example using the developer build of chrome and being able to use subsonic to stream a binary audio file. So far I have not had any luck though. Granted my next option will be try to load in the audio files into windowStorage and toss some magic dust on them. Does anybody know a way to stream a audio file to the ...

How to serialize SubSonic generated class?

I'm trying to use SubSonic with WCF. I can get data into List but I can't return that data to client side, its error is The socket connection has been disposed. Object name: 'System.ServiceModel.Channels.SocketConnection'. I try to send and retrieve data to/from WCF by POCO object and it working but when I try to use generated cl...

What is the current status of SubSonic ORM project?

VS2010 .Net4 Is SubSonic still the tool of choice? Are there easier ways to accomplish the creation of a DAL with the stock tools in VS2010? I need to convert a project that was done with Subsonic 2.03 several years ago and would like to hear opinions on the "right" way to do this. TIA J ...

Get Id back when using SubSonic SimpleRepository AddMany

How can I get the Id back to the object when I'm using the AddMany function with SubSonic SimpleRepository. All my objects still get Id=0 when after using it. SimpleRepository repository = new SimpleRepository(ConnectionStringName); repository.AddMany<T>(insertList); When looking at the source I can see that: public void AddMany<T>(I...

Possible to update a row without pulling down and updating every column?

For examples sake, lets say I have a table containing these columns ID (primary key, auto increment) FirstName (32 characters) LastName (32 characters) Picture (binary JPEG data containing on average 10k of data) Using SubSonic and/or LINQ how can I update only the FirstName column of a record and not try to get the Picture column or...

Sql Server batch insert takes 10s, problem?

Hi, I have a large batch insert using SubSonic which takes about 10s (sometimes more), will this produce any problems if my website tries to open another connection to my sql server? This batch won't happend that often, but I guess it will happend at the same time as an other connection at some point. And a related question: How man...

Subsonic SimpleRepository NullReferenceException in Contains with cast

Hi, I have a problem with this subsonic3.0.0.4 find statement: rep = new SimpleRepository(" ... "); rep.Find<MyObject>( x => x.Code.ToString("00000").Contains("023") ); The Code field is Long value and the sql query that I need is: *SELECT * FROM ... WHERE convert(varchar, Code) LIKE '%023%'* When I execute it, NullReferenceExceptio...

Subsonic:Selfjoin query need

Hi, I want to construct the query which is going to be used in .net. Below you can see the sql query, any one can give me the equivalent subsonic query SELECT DISTINCT a2.AccountID AS BID, a2.AccountName AS Brand FROM Account a INNER JOIN Account a2 ON a.ParentID = a2.AccountID WHERE a.AccountTypeID = 6 ORDER BY Brand Pl...

The member <some column> is not supported in SubSonic

Hello, I am using the T4 templates of SubSonic 3.0 to generate classes and such for me. Well in my database I have a Zipcode table with these columns ZipCode_rid Zipcode (the actual zipcode in number format) State etc Well, when the T4 templates run, instead of having a column like Zipcode.Zipcode I get Zipcode.ZipcodeX. Then, when t...