0

This is my first question here and I am sorry if i am to wide but I am not sure how to ask this in a narrow way.

I am learning to use code .net and mysql. I want to build a database application but I am not sure that this is a good way.

I am using Visual Studio 2015. I have created a new project, in that project I created a datasource to my mysql database. The database is containing a large amount of tables. Then in the main window I have dragged the datasource so I have a detailed view, so VS have autogenerated code in my project. If I run my project it shows the data from my database.

Now, in this table i am having problems with is a blob that contains pictures. I want the user to be able to add a picture. I have figured out to load the picture but I can't figure out how to actually insert the data into the table.

Maybe, I should scrap this way and use entity instead? am I wasting my time with trying to understand how to use the datasource function in VS? I have searched a week for a good tutorial that shows how to use datasources but I could not find anything useful and I really don't have a startingpoint on where i should start.

Anyone that help me sort things out ?

  • 2
    I think what you need to do is to convert the image to byte array and save it as a single string to your database. http://stackoverflow.com/questions/25400555/save-and-retrieve-image-binary-from-sql-server-using-entity-framework-6 – cafekun May 26 '16 at 07:14
  • I saved it as a byte[] and it works good. Thank you – Magnus Wirström May 26 '16 at 09:57

0 Answers0