Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
QuestionHow to delete a row from a dataGrid Pin
Imran Adam9-Jan-08 5:22
Imran Adam9-Jan-08 5:22 
GeneralSerializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 4:50
Skippums9-Jan-08 4:50 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Le centriste9-Jan-08 5:21
Le centriste9-Jan-08 5:21 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 8:10
Skippums9-Jan-08 8:10 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Le centriste9-Jan-08 8:24
Le centriste9-Jan-08 8:24 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 9:27
Skippums9-Jan-08 9:27 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Le centriste9-Jan-08 9:37
Le centriste9-Jan-08 9:37 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 10:17
Skippums9-Jan-08 10:17 
Yeah, I thought about doing that, but didn't like the fact that it no longer contained information about the type. Clients (of my WS) would see a string that looks like hex, but maybe it is a GUID without the slashes, or an IPv6 ip address without the colons... you get the idea. I was hoping there was an attribute to tell the serializer, "I have this enum that I want you to pass by hex value", then clients on the receiving end would get the type as enum and it would deserialize appropriately. Anyway, I came up with a different (probably better) way of doing what I was attempting to do (combining multiple fields into a single flags value). Instead of combining fields in a cryptic way for the end user of my service, I simply serialize a more verbose object back, splitting the fields into their own properties. The following illustrates this:
public enum Language {
    Spanish = 1,
    English = 2,
}
public enum Country {
    USA = 1,
    DEU = 2,
}
public class CountryAndLanguage { ... }
// The following is how I am serializing a CountryAndLanguage object containing USA & English

// Initial thought on serialization (expose the following as a property)
// ((uint)CAL.Country << 2 & (uint)CAL.Language)

// The new way to serialize, is to simply use the default serializer to
// verbosely serialize the properties Country and Language on the CAL object.
The reason I was attempting the first way was because I was misinformed that I could not return abstract types from a web service. Therefore, I thought that I had to have a concrete return type that would hold all the information contained within all derived types. This is incorrect, which is why I am now using the "correct" way of doing this mentioned above. Thanks again for the help,

Sounds like somebody's got a case of the Mondays

-Jeff

GeneralTo add to my other answer... Pin
Le centriste9-Jan-08 9:40
Le centriste9-Jan-08 9:40 
QuestionHow to invoke SQL Function through SqlCommand class Pin
El'Cachubrey9-Jan-08 4:06
El'Cachubrey9-Jan-08 4:06 
AnswerRe: How to invoke SQL Function through SqlCommand class Pin
led mike9-Jan-08 4:31
led mike9-Jan-08 4:31 
AnswerRe: How to invoke SQL Function through SqlCommand class Pin
andyharman9-Jan-08 4:44
professionalandyharman9-Jan-08 4:44 
QuestionHow to catch the event of thowing an exception in Visual Studio Pin
manustone9-Jan-08 3:51
manustone9-Jan-08 3:51 
Generalset child form height Pin
arkiboys9-Jan-08 2:29
arkiboys9-Jan-08 2:29 
GeneralRe: set child form height Pin
Stu Richardson9-Jan-08 2:40
Stu Richardson9-Jan-08 2:40 
GeneralRe: set child form height Pin
arkiboys9-Jan-08 2:49
arkiboys9-Jan-08 2:49 
GeneralRe: set child form height Pin
DaveyM699-Jan-08 3:08
professionalDaveyM699-Jan-08 3:08 
GeneralRe: set child form height Pin
arkiboys9-Jan-08 3:13
arkiboys9-Jan-08 3:13 
GeneralRe: set child form height Pin
DaveyM699-Jan-08 3:24
professionalDaveyM699-Jan-08 3:24 
GeneralRe: set child form height Pin
Stu Richardson9-Jan-08 3:27
Stu Richardson9-Jan-08 3:27 
GeneralRe: set child form height Pin
arkiboys9-Jan-08 3:27
arkiboys9-Jan-08 3:27 
GeneralRe: set child form height Pin
Dave Kreskowiak9-Jan-08 4:59
mveDave Kreskowiak9-Jan-08 4:59 
GeneralRe: set child form height Pin
DaveyM6910-Jan-08 1:12
professionalDaveyM6910-Jan-08 1:12 
GeneralGet GUID of Network Card Pin
Kamal.Afridi9-Jan-08 1:48
Kamal.Afridi9-Jan-08 1:48 
GeneralRe: Get GUID of Network Card Pin
Pete O'Hanlon9-Jan-08 2:07
mvePete O'Hanlon9-Jan-08 2:07 

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.