-
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
-
How can I make this selection: SELECT User .*, Filial.Nome FROM User INNER JOIN Filial ON User.FilialID = Filial.ID WHERE Usuario.ID = 1
-
Can any one help me how to write query for this select SELECT q_ar.id, q_ar.s_ar, q_ar.sura_ar, q_ar.a_ar, q_ar.ayat_ar, q_en.tr_y, q_en.tr_p, q_en.tr_s FROM q_ar INNER JOIN q_en ON q_ar.s_ar = q_en.s_en AND q_ar.a_ar = q_en.a_en ORDER BY q_ar.id Thanks, K
-
I use the SubSonic Select Command to query a table with about 20 rows and bind the result to a combobox. The statement looks something like this (sorry, VB Code): ComboBox1.DataSource = New [Select]() _ .From(TableObject.Schema).OrderAsc(TableObject.NameColumn.PropertyName) _ .ExecuteAsCollection(Of...
-
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 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...
-
Okay, I think that I've figured it out. SubSonic.SqlQuery qry = new SubSonic.Select( SubSonic.Aggregate.GroupBy(myTable.Columns.Item), SubSonic.Aggregate.Count(myTable.Columns.Item, "Total")). From(myTable.Schema); myGridView.DataSource = qry.ExecuteReader(); I also figured out how to add...
-
I'm having a problem where an AND clause for a query is not on the proper table when two tables in the query have the same field name and both are participating in the WHERE. Here is a query I'd like to generate from Subsonic's Select(): SELECT [dbo].[SA_Customer].[CustomerID], [dbo].[SA_Customer...
-
Hi guys, We've come across a bug where the following code throws a NullReferenceException (on SVN r432): SubSonic.SqlQuery q = new Select().From(Northwind.Tables.OrderDetail) .InnerJoin(Northwind.Tables.Product) .Where("CategoryID").IsEqualTo(5); A workaround for the time being is for us...
-
Ok....total n00b here. Can someone give me some simple examples of how to use SubSonic once the DAL is created. Thanks!