Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

MySQL and C#

vunalvunal Posts: 8Member
hi i store pictures into MySQL database and i use ""***MySQLDriverCS***""
during typecasting dataset field to byte array i have problem as

*****An unhandled exception of type 'System.InvalidCastException' occurred in******

here is my code

////////////////////////////////////////////////////////
MySQLConnection connection_goster = new MySQLConnection(new MySQLConnectionString("localhost","album","root","asd").AsString);
connection_goster.Open();

MySQLDataAdapter adapter_goster = new MySQLDataAdapter("select * from resim",connection_goster);

DataSet dataset_goster = new DataSet();

adapter_goster.Fill(dataset_goster,"resim");

buffer_goster = (byte[])dataset_goster.Tables["resim"].Rows[0][1];

Comments

Sign In or Register to comment.