Click here to Skip to main content
15,887,350 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError Pin
Member 1116162516-May-17 20:10
Member 1116162516-May-17 20:10 
AnswerRe: Error Pin
Kornfeld Eliyahu Peter16-May-17 21:27
professionalKornfeld Eliyahu Peter16-May-17 21:27 
AnswerRe: Error Pin
Richard MacCutchan16-May-17 21:36
mveRichard MacCutchan16-May-17 21:36 
AnswerRe: Error Pin
F-ES Sitecore16-May-17 22:11
professionalF-ES Sitecore16-May-17 22:11 
SuggestionRe: Error Pin
Richard Deeming17-May-17 1:24
mveRichard Deeming17-May-17 1:24 
QuestionTelerik version upgradation issue in Asp.net Pin
Member 1058746112-May-17 1:28
Member 1058746112-May-17 1:28 
SuggestionRe: Telerik version upgradation issue in Asp.net Pin
Richard Deeming12-May-17 4:08
mveRichard Deeming12-May-17 4:08 
QuestionGetting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
indian14311-May-17 8:56
indian14311-May-17 8:56 
Hi All,

I am trying to return a DataSet that has 6 table to a cshtml file from Web Api, that DataSet is created by using the Entities from Entity Framework the reason I am returning the DataSet is I am converting the Entity Collections as Tables and wrapping them in a DataSet and returning that.

But I am getting the following Exceptions, anybody can please help me in fixing it? Here is my Get method Code:
        public DataSet Get()
        {
            DataSet dsAllListsOfForm = new DataSet();
            dsAllListsOfForm.Tables.Clear();

            dynamic objCollection; DataTable table;
            using (AppDevSecEntities ctx = new AppDevSecEntities())
            {
                objCollection = (from c in ctx.Departments orderby c.DepartmentName select c).AsQueryable();
                table = Common.ConvertToDataTable<Department>(objCollection);
                dsAllListsOfForm.Tables.Add(table);

                objCollection = (from c in ctx.FunctionalCatagories orderby c.FunctionalCatagoryName select c).AsQueryable();
                table = Common.ConvertToDataTable<FunctionalCatagory>(objCollection);
                dsAllListsOfForm.Tables.Add(table);

                objCollection = (from c in ctx.BusinessUnits orderby c.BusinessUnitName select c).AsQueryable();
                table = Common.ConvertToDataTable<BusinessUnit>(objCollection);
                dsAllListsOfForm.Tables.Add(table);

                objCollection = (from c in ctx.Locations orderby c.LocationName select c).AsQueryable();
                table = Common.ConvertToDataTable<Location>(objCollection);
                dsAllListsOfForm.Tables.Add(table);
            }

            return dsAllListsOfForm;
       }

Any help/suggestion is going to be very helpful, I am really new to the MVC and FrontEnd tools because I was working with Integrations for quite a While, thanks in advance.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
SuggestionRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
ZurdoDev11-May-17 9:15
professionalZurdoDev11-May-17 9:15 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
indian14311-May-17 11:20
indian14311-May-17 11:20 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
ZurdoDev12-May-17 0:46
professionalZurdoDev12-May-17 0:46 
SuggestionRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
Richard Deeming12-May-17 1:19
mveRichard Deeming12-May-17 1:19 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
indian14317-May-17 7:16
indian14317-May-17 7:16 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
Richard Deeming17-May-17 7:30
mveRichard Deeming17-May-17 7:30 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
indian14317-May-17 10:39
indian14317-May-17 10:39 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
Richard Deeming17-May-17 11:23
mveRichard Deeming17-May-17 11:23 
GeneralRe: Getting the Excepption ExceptionType Newtonsoft.Json.JsonSerializationException in my Web API Pin
indian14317-May-17 12:14
indian14317-May-17 12:14 
Questionhow can i add gridview in asp.net page using c# Pin
Joker87AHAHAH10-May-17 7:26
Joker87AHAHAH10-May-17 7:26 
AnswerRe: how can i add gridview in asp.net page using c# Pin
User 418025414-May-17 19:04
User 418025414-May-17 19:04 
Questionpage doesnot autopostback on radio button Pin
prog.sidra10-May-17 2:25
prog.sidra10-May-17 2:25 
AnswerRe: page doesnot autopostback on radio button Pin
User 418025414-May-17 19:07
User 418025414-May-17 19:07 
AnswerRe: page doesnot autopostback on radio button Pin
senthilaaru18-May-17 4:34
senthilaaru18-May-17 4:34 
Questionasp .net and angular2 Pin
Member 121448819-May-17 19:59
Member 121448819-May-17 19:59 
AnswerRe: asp .net and angular2 Pin
Richard MacCutchan9-May-17 21:32
mveRichard MacCutchan9-May-17 21:32 
GeneralRe: asp .net and angular2 Pin
Member 1214488110-May-17 5:03
Member 1214488110-May-17 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.