Click here to Skip to main content
15,901,122 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to save combobox values in forms Pin
Richard MacCutchan31-Jul-16 21:23
mveRichard MacCutchan31-Jul-16 21:23 
GeneralRe: How to save combobox values in forms Pin
OriginalGriff31-Jul-16 21:27
mveOriginalGriff31-Jul-16 21:27 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 19:00
Member 126599261-Aug-16 19:00 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 20:18
mvePete O'Hanlon1-Aug-16 20:18 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 20:31
Member 126599261-Aug-16 20:31 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 20:35
mvePete O'Hanlon1-Aug-16 20:35 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 22:38
Member 126599261-Aug-16 22:38 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 23:36
mvePete O'Hanlon1-Aug-16 23:36 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 23:39
Member 126599261-Aug-16 23:39 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 23:53
mvePete O'Hanlon1-Aug-16 23:53 
GeneralRe: How to save combobox values in forms Pin
Member 126599262-Aug-16 1:13
Member 126599262-Aug-16 1:13 
QuestionEF 6 and C# applications (Web & Windows) Pin
Zeyad Jalil31-Jul-16 20:20
professionalZeyad Jalil31-Jul-16 20:20 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Nathan Minier1-Aug-16 3:50
professionalNathan Minier1-Aug-16 3:50 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Gerry Schmitz1-Aug-16 5:21
mveGerry Schmitz1-Aug-16 5:21 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Mycroft Holmes1-Aug-16 13:01
professionalMycroft Holmes1-Aug-16 13:01 
QuestionHow To Create Math Parser? Pin
Daniyaltjm31-Jul-16 2:12
Daniyaltjm31-Jul-16 2:12 
AnswerRe: How To Create Math Parser? Pin
OriginalGriff31-Jul-16 2:29
mveOriginalGriff31-Jul-16 2:29 
GeneralRe: How To Create Math Parser? Pin
Daniyaltjm31-Jul-16 4:07
Daniyaltjm31-Jul-16 4:07 
GeneralRe: How To Create Math Parser? Pin
OriginalGriff31-Jul-16 4:19
mveOriginalGriff31-Jul-16 4:19 
Questionneed help witch creating method Pin
Member 1138393529-Jul-16 23:55
Member 1138393529-Jul-16 23:55 
AnswerRe: need help witch creating method Pin
OriginalGriff30-Jul-16 0:11
mveOriginalGriff30-Jul-16 0:11 
QuestionParsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 1:48
Michael Breeden29-Jul-16 1:48 
AnswerRe: Parsing a string with multiple values - JSON or Retro? Pin
Richard Deeming29-Jul-16 2:09
mveRichard Deeming29-Jul-16 2:09 
Can you absolutely guarantee that the names and values will never contain either the : or | characters?

If not, then your "retro" approach will need to come up with some way to escape those characters when they appear in a name or value. And suddenly your parsing code becomes significantly more complicated.


With JSON, you can avoid the dynamic overhead by deserializing to a concrete type:
C#
public class YourClass
{
    public string BU { get; set; }
    public string DetailID { get; set; }
    public string unique_id { get; set; }
    public string job_id { get; set; }
    public string track_number { get; set; }
    public int job_count { get; set; }

    // Any other important properties you need to use...

    // You can even store unknown properties in a dictionary:
    [JsonExtensionData]
    public IDictionary<string, JToken> AdditionalData { get; set; }
}

...

YourClass data = JsonConvert.DeserializeObject<YourClass>(strData);

or to a dictionary:
C#
var data = JsonConvert.DeserializeObject<Dictionary<string, object>>(strData);


The only real way to know which option is more efficient is to profile your code.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 2:43
Michael Breeden29-Jul-16 2:43 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Richard Deeming29-Jul-16 2:47
mveRichard Deeming29-Jul-16 2:47 

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.