By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,501 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Is there an easy way to copy a DataView (or even the DataGrid showing the DataView) to the Clipboard?

P: n/a
I simply want to copy the DataView and paste it into an email. What's the
best way to accomplish that? I could obviously write the XML to a string
and copy the string, but that's "ugly" for an email.

Thanks.
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You could take the XML string, and perform an XSL transform on it to turn
into any format you like with any type of formatting.

"Kevin Brown" <no****@nospam.please> wrote in message
news:ej**************@TK2MSFTNGP14.phx.gbl...
I simply want to copy the DataView and paste it into an email. What's the
best way to accomplish that? I could obviously write the XML to a string
and copy the string, but that's "ugly" for an email.

Thanks.

Jul 21 '05 #2

P: n/a
Kevin,

A dataview is only an object that hold references to datarowview which again
reference to items in a datatable, so pasting it in a email will even when
you got it to the reader let the readoer over the internet give the one who
reads the message give the reference to your computer.

A serialized dataset should be very simple in my opinion to paste in.

However creating just a nice text or html message from it looks for me much
nicer for the one who has to read it. The last is of course my own opinion.

I hope this helps?

Cor
Jul 21 '05 #3

P: n/a
Cor Ligthert wrote:
Kevin,

A dataview is only an object that hold references to datarowview
which again reference to items in a datatable, so pasting it in a
email will even when you got it to the reader let the readoer over
the internet give the one who reads the message give the reference to
your computer.

A serialized dataset should be very simple in my opinion to paste in.

However creating just a nice text or html message from it looks for
me much nicer for the one who has to read it. The last is of course
my own opinion.

I hope this helps?

Cor


Ok - I created an HTML table to represent the data and copied it to the
clipboard. However, if I switch to Outlook and paste into a new message, I
see nothing. The code I wrote was:

(build the string...)

Encoding enc = Encoding.UTF8;

DataObject obj = new DataObject();
obj.SetData(DataFormats.Html, new
System.IO.MemoryStream(enc.GetBytes(str)));
Clipboard.SetDataObject(obj, true);

What's wrong?
Jul 21 '05 #4

P: n/a
Kevin,

And you did that in 12 minutes after that I wrote my message. Maybe you try
to find the answer first yourself?

Cor
Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.