-
i just like to know if can create this sql i subsonic SELECT Id, Title, Body, Slug, CreatedOn FROM Posts WHERE (DATEPART(Month, CreatedOn) = 9) AND (DATEPART(Year, CreatedOn) = 2008) ORDER BY CreatedOn DESC
-
I have two providers in a web project and it appears that the schema is not being generated for any of my tables and views in the second provider. SubStage builds the table and view classes ok - I've visually compared the classes generated for my second provider to those of my first provider and...
-
I was looking through the 2.1 Final source code, and noticed that the Sql2008Generator class inherits from ANSISqlGenerator and not Sql2005Generator. This makes sense I suppose, except that the Sql2008Generator is empty - it does not override the BuildPagedSelectStatement() function like the Sql2005Generator...
-
Guys, how can I do a select statement in subsonic like this: select OneTable.ID as [ID One], OneTable.Name as [Name One], TwoTable.ID as [ID Two], TwoTable.Name as [Name Two] from OneTable inner join TwoTable on OneTable.ID = TwoTable.OneTableID I tried this: using (IDataReader rdr = DB.Select("OneTable...
-
I'm using this SQL and QueryCommand to group by a DateTime field but using the Date portion: SELECT Count(0) as myCount, CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, myDateTimeField))) as myDateTimeField FROM myTable WHERE myOtherField = 1 ... GROUP BY CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, myDateTimeField...
-
I'm using SqlQuery and the below syntax (field and table names changed) Table with 4 columns: myGuidField, myDateField, myNumberField, myStringField SqlQuery qry = new Select( Aggregate.Avg(myTable.Columns.myNumberField), Aggregate.GroupBy(myTable.Columns.myStringField)) .From(myTable.Schema) .Where...
-
I'm working with Pakala 2.1.3 and have hit an error. When using the DB.Save(RepObj) function an exception is thrown (Incorrect syntax near the keyword 'WHERE'.). Drilling into the exception, I found this information which may help. _commandText = "UPDATE [dbo].[ControlParms] SET WHERE...
-
Here's what I did ... who knows if it's efficient. After working on it all afternoon, I'm glad it works: Select the list to be excluded convert the collection to an array of objects pass the array to the new collection selection as an array attached to the NotIN. You may have to stumble through...
-
We have a distributed application. The customer can use Access or SQL just by changing the connection string. Will it still work if we use Subsonic, or would we have to have two separate versions of the software. It sounds like you need to regenerate Subsonic if you change your connection string. That...
-
Hi, I was always told that embedding SQL in source code was bad practice in terms of security - showing database structure in source code. Wouldn't this be the same for the subsonic "query" method calls which show the database structure? Thanks, Kenny