Click here to Skip to main content
15,867,835 members
Home / Discussions / C#
   

C#

 
QuestionRe: Need Help!! Pin
Eddy Vluggen29-Aug-14 11:53
professionalEddy Vluggen29-Aug-14 11:53 
AnswerRe: Need Help!! Pin
Pete O'Hanlon29-Aug-14 12:09
subeditorPete O'Hanlon29-Aug-14 12:09 
QuestionAfter create setup Window form Application Following Error:- Pin
Nishant.Chauhan8029-Aug-14 2:17
Nishant.Chauhan8029-Aug-14 2:17 
AnswerRe: After create setup Window form Application Following Error:- Pin
Dave Kreskowiak29-Aug-14 2:32
mveDave Kreskowiak29-Aug-14 2:32 
AnswerRe: After create setup Window form Application Following Error:- Pin
Richard MacCutchan29-Aug-14 2:35
mveRichard MacCutchan29-Aug-14 2:35 
Questionhow to dropdownlist foreign keys? Pin
Member 1102146428-Aug-14 23:20
Member 1102146428-Aug-14 23:20 
AnswerRe: how to dropdownlist foreign keys? Pin
Pete O'Hanlon28-Aug-14 23:35
subeditorPete O'Hanlon28-Aug-14 23:35 
QuestionJSON Parsing Data Pin
Alex.bordei28-Aug-14 22:15
Alex.bordei28-Aug-14 22:15 
Hello guys,

I have a little problem, and I don't know how to make things works.

This is a JSON respone from a website:

{
"data": {
"status": 1,
"status_message": "Comanda a fost introdusa!",
"comanda": {
"id_comanda": "404",
"pret_total": 35,
"modalitate_plata": "Card online"
}
},
"error": false,
"errors": []
}

And I want to parse the values to my console application script.

I build this structure for JavaScriptSerializer:

C#
public class Comanda
            {
                public string id_comanda { get; set; }
                public int pret_total { get; set; }
                public string modalitate_plata { get; set; }
            }

            public class Data
            {
                public int status { get; set; }
                public string status_message { get; set; }
                public Comanda comanda { get; set; }
            }

            public class RootObject
            {
                public Data data { get; set; }
                public bool error { get; set; }
                public List<object> errors { get; set; }
            }



And I get the value for error response:

C#
RootObject GetProduse_vars = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<RootObject>(text);
                Console.WriteLine(GetProduse_vars.error);

And "text" variable contains the JSON response.

Can you guys help me to find a solution to get the values from id_comanda and pret_total strings?

Thanks a lot!
Alex Bordei

AnswerRe: JSON Parsing Data Pin
Freak3028-Aug-14 23:00
Freak3028-Aug-14 23:00 
GeneralRe: JSON Parsing Data Pin
Alex.bordei29-Aug-14 2:43
Alex.bordei29-Aug-14 2:43 
QuestionC# connection between two SQLExpress servers on one machine Pin
Member 1103943928-Aug-14 18:44
Member 1103943928-Aug-14 18:44 
AnswerRe: C# connection between two SQLExpress servers on one machine Pin
Kornfeld Eliyahu Peter28-Aug-14 20:16
professionalKornfeld Eliyahu Peter28-Aug-14 20:16 
GeneralRe: C# connection between two SQLExpress servers on one machine Pin
Member 1103943928-Aug-14 20:28
Member 1103943928-Aug-14 20:28 
GeneralRe: C# connection between two SQLExpress servers on one machine Pin
Paul Conrad29-Aug-14 18:47
professionalPaul Conrad29-Aug-14 18:47 
AnswerRe: C# connection between two SQLExpress servers on one machine Pin
PIEBALDconsult2-Sep-14 8:24
mvePIEBALDconsult2-Sep-14 8:24 
QuestionUsing Process.Start on Excel Pin
mjackson1128-Aug-14 8:35
mjackson1128-Aug-14 8:35 
AnswerRe: Using Process.Start on Excel Pin
Richard Deeming28-Aug-14 9:59
mveRichard Deeming28-Aug-14 9:59 
GeneralRe: Using Process.Start on Excel Pin
mjackson1128-Aug-14 10:15
mjackson1128-Aug-14 10:15 
GeneralRe: Using Process.Start on Excel Pin
Richard Deeming29-Aug-14 1:41
mveRichard Deeming29-Aug-14 1:41 
GeneralRe: Using Process.Start on Excel Pin
mjackson1129-Aug-14 1:55
mjackson1129-Aug-14 1:55 
AnswerRe: Using Process.Start on Excel Pin
Bernhard Hiller28-Aug-14 21:15
Bernhard Hiller28-Aug-14 21:15 
QuestionInterop.Excel.Range query Pin
Dini Ngewu28-Aug-14 0:55
Dini Ngewu28-Aug-14 0:55 
AnswerRe: Interop.Excel.Range query Pin
Dini Ngewu28-Aug-14 0:59
Dini Ngewu28-Aug-14 0:59 
QuestionUnable to connect to the remote server when calling web services from code in 4.5 framework. Pin
Member 1101964328-Aug-14 0:48
Member 1101964328-Aug-14 0:48 
AnswerRe: Unable to connect to the remote server when calling web services from code in 4.5 framework. Pin
Gerry Schmitz28-Aug-14 5:28
mveGerry Schmitz28-Aug-14 5:28 

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.