MySqlConnection con= new MySqlConnection("server=localhost;database=databasename;user=username;password=password");
string query="select *from table";
using (MySqlDataAdapter adpt= new MySqlDataAdapter(query,con))
{
DataSet dset= new DataSet();
adpt.Fill(dset);
mytableDataGridView.DataSource=dset.Tables[0];
}
con.close
the following code can only retrieve data of varchar and int, don't retrieve BLOB kind of data ....plzz give a solution so that blob can be read by this method or any other method with downloadable file mode
The Blob data should be read from the database into a byte array. Something like this should do it:
I took the code from here: https://www.akadia.com/services/dotnet_read_write_blob.html. Note that you could load the BLOB into a memory stream instead of a filestream if you wanted to simply display the BLOB on the screen e.g. if it is a photo.