Save data from my sql database to pdf file - C#

ساخت وبلاگ

Vote count: 0

I have an employee table in a MySQL database, I have regular columns as full name, date hired, etc. I have also a column which stores binary (blob) data for each employee which I know it’s a pdf file. Now, I want to save each of this binary files into a pdf file on my computer, in C#.

I saw a few forms similar to my scenario, but wasn’t help me.

Here is what I have so far:

 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MySql.Data.MySqlClient; namespace MySqlExport { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { MySqlConnection connection = DBconnection.GetDBconnection(); string selectString = " select pdfFile, fullName from Employee "; MySqlCommand selectCommand = new MySqlCommand(selectString, connection); connection.Open(); MySqlDataReader reader = selectCommand.ExecuteReader(); reader.Read(); // now whats next??......... } catch (Exception ex) { MessageBox.Show(ex.Message); } }

Thank you everybody for your help.

asked 12 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 346 تاريخ : سه شنبه 26 ارديبهشت 1396 ساعت: 20:49