Click here to Skip to main content
15,910,121 members
Home / Discussions / C#
   

C#

 
Questioninsert into database with foreach Pin
h_floppy25-May-09 3:44
h_floppy25-May-09 3:44 
AnswerRe: insert into database with foreach Pin
Manas Bhardwaj25-May-09 3:51
professionalManas Bhardwaj25-May-09 3:51 
QuestionHelp Me Pin
Nabende25-May-09 2:55
professionalNabende25-May-09 2:55 
AnswerRe: Help Me Pin
OriginalGriff25-May-09 4:34
mveOriginalGriff25-May-09 4:34 
QuestionSpecial thanks to all members Pin
Nabende25-May-09 2:40
professionalNabende25-May-09 2:40 
AnswerRe: Special thanks to all members Pin
EliottA25-May-09 3:28
EliottA25-May-09 3:28 
QuestionAbort a suspended thread Pin
yesu prakash25-May-09 1:56
yesu prakash25-May-09 1:56 
AnswerRe: Abort a suspended thread Pin
Luc Pattyn25-May-09 2:04
sitebuilderLuc Pattyn25-May-09 2:04 
GeneralRe: Abort a suspended thread Pin
Fahad Sadah25-May-09 2:07
Fahad Sadah25-May-09 2:07 
AnswerRe: Abort a suspended thread Pin
Fahad Sadah25-May-09 2:05
Fahad Sadah25-May-09 2:05 
QuestionDelegates and Parallel.For Pin
Fahad Sadah25-May-09 1:25
Fahad Sadah25-May-09 1:25 
AnswerRe: Delegates and Parallel.For Pin
S. Senthil Kumar25-May-09 3:38
S. Senthil Kumar25-May-09 3:38 
GeneralRe: Delegates and Parallel.For Pin
harold aptroot25-May-09 3:39
harold aptroot25-May-09 3:39 
GeneralRe: Delegates and Parallel.For Pin
S. Senthil Kumar25-May-09 3:52
S. Senthil Kumar25-May-09 3:52 
GeneralRe: Delegates and Parallel.For Pin
Fahad Sadah25-May-09 7:26
Fahad Sadah25-May-09 7:26 
AnswerRe: Delegates and Parallel.For Pin
Nicholas Butler25-May-09 7:54
sitebuilderNicholas Butler25-May-09 7:54 
QuestionSlide bar Pin
yesu prakash25-May-09 1:18
yesu prakash25-May-09 1:18 
AnswerRe: Slide bar Pin
Eduard Keilholz25-May-09 3:37
Eduard Keilholz25-May-09 3:37 
QuestionAccessing the right Registry entry for Internet Explorer in C# Pin
ramz_g25-May-09 1:05
ramz_g25-May-09 1:05 
AnswerRe: Accessing the right Registry entry for Internet Explorer in C# Pin
Rajesh R Subramanian25-May-09 4:03
professionalRajesh R Subramanian25-May-09 4:03 
QuestionXmlTextWriter and MemoryStream Pin
OriginalGriff25-May-09 1:05
mveOriginalGriff25-May-09 1:05 
Is there any way to get a XmlTextWriter to work with a MemoryStream, so that it doesn't close it when it is finished?
What I'm trying to do is:
List<T> -> MemoryStream (as XML) -> TripleDES encyrption -> file.
And later:
file -> TripleDES decryption -> MemoryStream -> List<T>

And since XmlTextWriter always closes the stream when it completes, the MemoryStream is useless!
Yes, XMLTextWriter has settings, but they are null or read-only, so you can't set "CloseOutput = false"

(No, I don't want to use XMLSerialiser, for very dull reasons!)

I have got round it by moving to XmlWriter and using the settings that way, but this was such a waste of time!

Old way:
WriteXML(listCards, new XmlTextWriter(stream, Encoding.UTF8));
if (stream.CanSeek)
    {
    stream.Seek(0, 0);
    }

New way:
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = false;
settings.ConformanceLevel = ConformanceLevel.Document;
settings.CloseOutput = false;
settings.Indent = true;
settings.Encoding = Encoding.UTF8;
WriteXML(listCards, XmlWriter.Create(stream, settings));
if (stream.CanSeek)
    {
    stream.Seek(0, 0);
    }


No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

Question7.1 Surround Sound Pin
Chris MacEwan25-May-09 0:51
Chris MacEwan25-May-09 0:51 
AnswerRe: 7.1 Surround Sound Pin
molesworth25-May-09 2:18
molesworth25-May-09 2:18 
Questionopen aspx page Pin
michaelgr125-May-09 0:50
michaelgr125-May-09 0:50 
AnswerRe: open aspx page Pin
padmanabhan N25-May-09 1:31
padmanabhan N25-May-09 1:31 

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.