Click here to Skip to main content
15,888,579 members
Home / Discussions / C#
   

C#

 
AnswerRe: Copy Class to Another Class - Cast Problem Pin
N a v a n e e t h13-Sep-09 3:25
N a v a n e e t h13-Sep-09 3:25 
GeneralRe: Copy Class to Another Class - Cast Problem Pin
dataminers13-Sep-09 3:50
dataminers13-Sep-09 3:50 
GeneralRe: Copy Class to Another Class - Cast Problem Pin
N a v a n e e t h13-Sep-09 17:49
N a v a n e e t h13-Sep-09 17:49 
GeneralRe: Copy Class to Another Class - Cast Problem Pin
dataminers14-Sep-09 23:33
dataminers14-Sep-09 23:33 
AnswerRe: Copy Class to Another Class - Cast Problem Pin
Eddy Vluggen13-Sep-09 3:42
professionalEddy Vluggen13-Sep-09 3:42 
GeneralRe: Copy Class to Another Class - Cast Problem Pin
dataminers13-Sep-09 3:51
dataminers13-Sep-09 3:51 
GeneralRe: Copy Class to Another Class - Cast Problem Pin
Eddy Vluggen13-Sep-09 3:54
professionalEddy Vluggen13-Sep-09 3:54 
GeneralRe: Copy Class to Another Class - Cast Problem Pin
dataminers13-Sep-09 4:01
dataminers13-Sep-09 4:01 
How can I following class for my class;
I GET ERROR

public object Copy(Type source, object sourceToCopy, Type destination)
{
XmlSerializer serializer = new XmlSerializer(source);
MemoryStream memoryStream = new MemoryStream();

XmlSerializerNamespaces nameSpacesList = new XmlSerializerNamespaces();
nameSpacesList.Add("", "");

serializer.Serialize(memoryStream, sourceToCopy, nameSpacesList);

byte[] byteArr = memoryStream.ToArray();
ASCIIEncoding encoder = new ASCIIEncoding();
string xmlString = encoder.GetString(byteArr);

ASCIIEncoding newEncoder = new ASCIIEncoding();
byte[] newByteArr = newEncoder.GetBytes(xmlString);
MemoryStream newMemoryStream = new MemoryStream(newByteArr);

XmlSerializer deSer = new XmlSerializer(destination);

object deserializedObject = deSer.Deserialize(newMemoryStream);

return deserializedObject;
}
GeneralRe: Copy Class to Another Class - Cast Problem Pin
J4amieC13-Sep-09 4:53
J4amieC13-Sep-09 4:53 
AnswerRe: Copy Class to Another Class - Cast Problem Pin
J4amieC13-Sep-09 4:55
J4amieC13-Sep-09 4:55 
AnswerRe: Copy Class to Another Class - Cast Problem Pin
PIEBALDconsult13-Sep-09 5:10
mvePIEBALDconsult13-Sep-09 5:10 
QuestionThe remote certificate is invalid according to the validation procedure. Pin
khosnur13-Sep-09 2:17
khosnur13-Sep-09 2:17 
Questionpop3 secure mail download using C# Pin
khosnur13-Sep-09 0:51
khosnur13-Sep-09 0:51 
AnswerRe: pop3 secure mail download using C# Pin
Richard MacCutchan13-Sep-09 1:31
mveRichard MacCutchan13-Sep-09 1:31 
GeneralRe: pop3 secure mail download using C# Pin
khosnur13-Sep-09 2:22
khosnur13-Sep-09 2:22 
GeneralRe: pop3 secure mail download using C# Pin
Richard MacCutchan13-Sep-09 3:18
mveRichard MacCutchan13-Sep-09 3:18 
AnswerRe: pop3 secure mail download using C# Pin
dan!sh 13-Sep-09 1:42
professional dan!sh 13-Sep-09 1:42 
GeneralRe: pop3 secure mail download using C# Pin
khosnur13-Sep-09 2:28
khosnur13-Sep-09 2:28 
GeneralRe: pop3 secure mail download using C# Pin
dan!sh 13-Sep-09 3:53
professional dan!sh 13-Sep-09 3:53 
QuestionRetreive Email & Attachments [modified] Pin
kdwarak13-Sep-09 0:16
kdwarak13-Sep-09 0:16 
AnswerRe: Retreive Email & Attachments Pin
Richard MacCutchan13-Sep-09 1:33
mveRichard MacCutchan13-Sep-09 1:33 
QuestionLoading Excel into sqlserver Pin
kdwarak12-Sep-09 23:37
kdwarak12-Sep-09 23:37 
AnswerRe: Loading Excel into sqlserver Pin
dan!sh 13-Sep-09 0:58
professional dan!sh 13-Sep-09 0:58 
QuestionPrintDoc PrintPreview problem with random numbers Pin
Hilary Jenkinson12-Sep-09 23:18
Hilary Jenkinson12-Sep-09 23:18 
AnswerRe: PrintDoc PrintPreview problem with random numbers Pin
OriginalGriff12-Sep-09 23:28
mveOriginalGriff12-Sep-09 23: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.