How to store 3d models aspecially STL files in database?

Ardahan 5 years ago in Question updated 5 years ago 5

I'am reading an STL file in my WPF c# application. I want to store it to database. All database connections are done but I don't know how to store 3d model in database. What kind of converting needed for this purpose? And later similarly I want to get that information from database to turn it 3d models.Is there any basic function for STL converting to binaries then merging it again?

WPF Media3D

Update#1: I store STL files in database. Firstly I convert STL file to binary, then read all bytes. To store database I partitioning it to 400KB for each part. Then I load all of part to database sequentially. Therefore its much faster to load part by part contrary loading all files in one step.

For any answer which present improved solution I will accept it. Because I know that this method is very simple and not enough for performance while getting all parts consume a lot of time(i.e for 3MB file it needs 3-5 minutes approximately).

I'm wondering if it might not be better to store the files location instead, or look into a different database. I use MSSQL Server 2012 with Entity Framework 4 to store binary data in a different type of program. These data are around 3-5 MB and it just take a few seconds to load it.

I am also using MSSQL Server 2012 but it is not mine. I am use a free hosting service called somee.com. It gives 15MB free MSSQL 2012 and when I load data about size of 5-9MB it loads very slow like around 60 seconds.

Is this because of using free hosting or it is normal for that given size of data.

It could be a combination of those things. Can you test locally?

I have no time for trying to that because my project presentation will be just in a few days. Anyway I must do that with server based database. I can't use local database like SQLite.