This question is locked. New answers and comments are not allowed.
As a normal developer I am using this control and the AJAX is throwing exception because for some unknown reason the GridAction is making a call to the database server with the order by content. The content type in database is of text.
I've tried it through [GridAction(Order = 3)] but no luck.
I don't know why it is doing a order by content.
I've tried it through [GridAction(Order = 3)] but no luck.
Controller has got
this
:
[GridAction]
public
ActionResult AjaxPager(
string
sessionID,
string
ownerType,
int
ownerID,
int
? page)
{
var listData = GetNotes(ownerType, ownerID);
return
View(
new
GridModel(listData));
}
private
IEnumerable<NoteViewModel> GetNotes(
string
ownerType,
int
ownerID)
{
DataModel ds =
new
DateModel();
return
from o
in
ds.GetOwnerNotes(ownerType, ownerID)
select
new
NoteViewModel
{
NoteID = o.noteID,
Category = o.category,
Content = o.content,
Branch = o.branch,
DateMade = o.dateMade,
UserID = o.userID
};
}
I don't know why it is doing a order by content.
exec
sp_executesql N
'SELECT TOP (10)
[Project1].[ownerID] AS [ownerID],
[Project1].[noteID] AS [noteID],
[Project1].[category] AS [category],
[Project1].[content] AS [content],
[Project1].[branch] AS [branch],
[Project1].[dateMade] AS [dateMade],
[Project1].[userID] AS [userID]
FROM ( SELECT
[Extent1].[dateMade] AS [dateMade],
[Extent1].[content] AS [content],
[Extent1].[category] AS [category],
[Extent1].[ownerID] AS [ownerID],
[Extent1].[userID] AS [userID],
[Extent1].[noteID] AS [noteID],
[Extent1].[branch] AS [branch]
FROM [dbo].[Note] AS [Extent1]
WHERE ([Extent1].[ownerID] = @p__linq__0) AND ([Extent1].[ownerType] = @p__linq__1)
) AS [Project1]
ORDER BY [Project1].[content] ASC'
,N
'@p__linq__0 int,@p__linq__1 varchar(8000)'
,@p__linq__0=1,@p__linq__1=
'Employee'
Server Error in '/' Application.
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.