Hi,
Am trying to work with nHibernate and execute a query get the return value of the query output as IList Collection.
if i try to retrieve all the column value by using the "From" and populate the IList collection and assign that object to the data source of the radGrid its working fine.
If i try to retrieve specific columns using the "Select" and populate the IList Collection and assign the same object to the data source of the radGrid its not working properly
In the above Code. if i try to get the value by passing the Query in the "FormatedQuery" variable its working fine
The same is not working fine if i use the query in the Commented Line.
Pls guide me how to proceed.
Jidesh
Am trying to work with nHibernate and execute a query get the return value of the query output as IList Collection.
if i try to retrieve all the column value by using the "From" and populate the IList collection and assign that object to the data source of the radGrid its working fine.
If i try to retrieve specific columns using the "Select" and populate the IList Collection and assign the same object to the data source of the radGrid its not working properly
| private Void FormatQuery(string sTableName) |
| { |
| string FormatedQuery = ""; |
| FormatedQuery = "from " + sTableName.ToUpper().ToString() + "Entity A"; |
| //FormatedQuery = "Select a.FIRST_NAME,a.COMMENTS from " + sTableName.ToUpper().ToString() + "Entity a"; |
| IList data; |
| CommonDataAccess CommonData = new CommonDataAccess(); |
| data = GetData(FormatedQuery); |
| Simple_Grid.DataSource = data; |
| } |
| public IList GetData(string sSQL) |
| { |
| ISession sDataSession = NHibernateHelper.GetCurrentSession(); |
| IList oDataObj = sDataSession.CreateQuery(sSQL).List(); |
| return oDataObj; |
| } |
In the above Code. if i try to get the value by passing the Query in the "FormatedQuery" variable its working fine
The same is not working fine if i use the query in the Commented Line.
Pls guide me how to proceed.
Jidesh
