sending datagridview by email
-
Monday, January 02, 2012 12:44 PM
Hi,
I am using vb2008 express.i need to send datagridview by email to my boss. Please help me with the code.
Thanks in advance.
All Replies
-
Wednesday, January 04, 2012 7:11 AMModerator
Hi k rabbi,
In which way you prefer the DataGridView be sent? As attachment or email body?
Send as attachment:
You can first export the data of Datagridview to an Excel spreadsheet, and then send this excel file as attachment of the email.
For exporting Datagridview to Excel:
http://social.msdn.microsoft.com/Forums/en-PH/vbgeneral/thread/efe7f893-6e0c-4c50-b27c-a3a07348945f
http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/1a64be7d-58fa-4686-b956-05d857f0b3d4
For sending email:
http://msdn.microsoft.com/en-us/library/system.net.mail.aspx
An article here demonstrates how to send Datagridview contents both in email body and as attachment is also for your reference. http://www.codeproject.com/KB/grid/Send_DataGridView_Mail.aspx
Have a nice day,
Kee Poppy [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Kee PoppyModerator Monday, January 09, 2012 9:14 AM
-
Thursday, January 05, 2012 3:03 PM
Hi kee poppy,
thank u . i got it.
rabbi

