.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Examples for custom query using nhibernate in asp.net 3.5

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :WPF
I am doing a project in which i am using nhiberante ORM, In that they provide default method, but i req. more custom query like getting data by using join, to get particular column, So, i req. help from expert developers, plz help me. Thanks in advanced.

View Complete Post

More Related Resource Links

DateTime custom managed property search fails with " Your query is malformed. Please rephrase your q

I've created a front end search page in Silverlight 4 for SharePoint Search.  Currently we are using WSS 3.0 + Search Server Express 2008 (v  The page interacts with the MOSS version of the search web service at:   <site collection>/_vti_bin/search.asmx The reason for this approach is the unique way the requirements specify the look and behavior of the results.  The built-in Search Center page or web parts will not satisfy these requirements. We are going into production but I still cannot figure out how to search against my custom managed properties that are of Type DateTime.  If I cannot get this to work, it is a showstopper. I've tried numerous variations on the SQL Syntax and cannot get it to work.  I know the error is in the date portion of the WHERE clause since I can remove it and searches work fine. Here is a working query: SELECT Size, Rank, Path, Title, Description, Write, RequestSubmittedDate, DocumentType, RequestPromisedDate, ProblemDescription, DatePublished, RequestOwner, RequestingDepartment, DocumentAuthor, ProjectNumber, ProjectDescription, RequestStatus FROM scope() WHERE CONTAINS ('"nmr"') ORDER BY "Rank" DESC yet if I try to use a date literal in the WHERE clause as in the following query modification, I get the "malformed"

Problem with Content Query Webpart and Custom Userfields

Dear Community, I am using Sharepoint 2007's content query webpart to access content types from 2 lists each contained in a different sitecollection. To achieve this, I used this tutorial: http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx. The tutorial worked great. By using the property CommonViewFields and modifing the XML Stylesheets accordingly, i could access almost every field. Even User Fieldtypes like editor and author were accessible by adding (editor,User) or (author,User) to the CommonViewFields property. But when I tried to access the custom made userfield "Username" in the same way (adding Username,User to the property), the webpart threw an error and couldn't be displayed anymore. When I changed it to Username,Text , no error occured but it naturally didn't show up, since it is the wrong fieldtype. I hope some of you can help me, since all my researches on this topic only brought up some more people with the same problem, but no solution to it. Thanks in advance, SoundofSilence

Query Correlation faliure using custom Request/Reply Message Contract classes.

Hi,I have a service which is correlated by a Guid query. When I'm using designer created Message Content/Parameters feature for message definition, everithing working lika a charm. But If I define custom [MessageContract] Request/Reply classes (where request class has Guid SvcUID property for correlation), and choose'em as Message Content in the designer with proper CorrelatesOn definition of course, I have got a service exception about correlation query faliure. Have you folks tried to apply your custom [MessageContract] classes for correlated communication?

Create a Source from a custom sql query.


Hi I am back with another newbie question.

I am trying to write a data source with complex joins (more than 3 tables). And though I can do it with merge/join transformation, it is more simpler to write the query in place of the source.

the Lookup transformation allows me to write  a SQL query but it requires an input data source. What I want is that the custom query itself is the data source. Is there any transformation/option available for me to do it?

any help would be highly appreciated.

Ganesh Ranganathan
[Please mark the post as answer if it answers your question]

Trouble working examples of Cumulative columns in SQL Query


I can run the following query without the built in query in the select statement and it works fine.  All i am trying to do is to create a cumulative total for each day for a specific date range.  Any ideas?


SELECT OrderHed.OrderDate,

     (SELECT SUM(OD.OrderQty * OD.ListPrice)

        FROM   MFGSYS.PUB.OrderDtl OD INNER JOIN MFGSYS.PUB.OrderHed OH ON (OD.Company=OH.Company) AND (OD.OrderNum=OH.OrderNum)

        WHERE OH.orderdate<=OrderHed.OrderDate)

 FROM   MFGSYS.PUB.OrderDtl OrderDtl INNER JOIN MFGSYS.PUB.OrderHed OrderHed ON (OrderDtl.Company=OrderHed.Company)

    AND (OrderDtl.OrderNum=OrderHed.OrderNum)

 WHERE  (OrderHed.OrderDate>={d '2010-10-01'}

    AND OrderHed.OrderDate<={d '2010-10-31'})

    AND OrderDtl.Company='HEAPG'

    AND OrderDtl.RMANum<1

 GROUP BY OrderHed.OrderDate

 ORDER BY OrderHed.OrderDate

Select Query to get records within last 24 hours in Nhibernate


Hi All

How to Retrive records within last 24 hrs using Nhibernate.
I want to retrieve the 10 records within last 24 hours.

How can i achieve this using Nhibernate.

Please Help.

HQL Query with Nhibernate





i want to pick a specific column from the DataBase table  "department" , the column name is
'DeptName'   working with HQL   in Nhibernate














IList<CMM_Dept_Info> GetAllDeptNames()ICriteria criteria = Session.CreateCriteria<CMM_Dept_Info>("SELECT Dept_Name FROM CMM_Dept_Info");return criteria.List<CMM_Dept_Info>();<

Nhibernate query ? specific field


how to pick a specific field (besides Primarykey field ) through HQL query ???

Reference query values from custom code


How can I reference query values from custom code?

Normally in the expression I can use Fields!QueryValueX.Value

In custom code I can reference textboxes, for example - if ReportItems are passed as the parameter

But this doesnt include the query items

Javier Guillen

Question about a custom InfoPath 2003 Query


I have searched the web and youtube but cannot find anything. I have published a InfoPath form to a SharePoint list, and created a "Receive" connection. I need help creating the search to pull data using 2 dropdown boxes and a Query button. Here are the steps. (this is NOT a web form, just a standard form)

1. The user will choose Q1, Q2, Q3 or Q4 from the 1st dropdown box.

2. Then choose Submitted, Review, or Stage3 from the 2nd dropdown box. 

3. Then click the Query button. 

4. Then I want the results to be displayed in a repeating table with controls. (which I already have setup)

Any help to build the query logic would be greatly appreciated! 

Thank you for your time!''


YTD with custom query parameter (SSRS with SSAS)


Hi all,

I have a report which has SSAS as DataSource.

I also created a custom query parameter for date.
I am using the parameter type "date/time" (so I get the nice calendar for the parameter). Of course I have to convert this to a valid member of the SSAS hierarchy:

="[Datum].[Jahr - Halbjahr - Quartal - Monat - Datum].[Datum].[" + Format(CDate(Parameters!Datum.Value), "MMM d, yyyy") + "]"

So far, so good.

But I don't get the YTD function to work.
It should work like this.

WITH MEMBER [Measures].[Current YTD] AS

SUM(YTD([Datum].[Jahr - Halbjahr - Quartal - Monat - Datum].CurrentMember),[Measures].[Einheiten]) MEMBER [Measures].[Last YTD] AS SUM(YTD(ParallelPeriod([Datum].[Jahr - Halbjahr - Quartal - Monat - Datum].[Jahr],1,[Datum].[Jahr - Halbjahr - Quartal - Monat - Datum].CurrentMember)),[Measures].[Einheiten])

I tried to use STRTOMEMBER(@Datum) and STRTOSET(@Datum). But I guess reference to the hierarchy is missing.

Any tipps, how to get that working.

Thx a lot.

Reto E.

How to configure the file results of a query to custom delimiter


Hi all,

I use to do it is MS-SQL Analyzer to SQL 2000, but now with new MS SQL 2008 Management Studio I don't know how.

In the Tools->Options->Query Results to a file there isn't a option to custom delimiter... that I can see...

Any help would be apreciated.





Customize content query web part in custom page layout


I am trying to build a custom page layout which should have the following web parts:

1. Announcements,

2. Doc Library

3. custom list items

And the data in these web parts should be from the site in which we create this page. For example, if we try to create a page in site A, then the announcements displayed should be from site-A, doc lib that is in site-A...

And I am trying to insert a content query web part in the page layout using sharepoint designer, and modify the query to insert the announcements list in the site. But how can I query to pull the data from corresponding site.

Thanks for the help.

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Writing custom MembershipProvider

ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend