Save files on SQL 2008. Need advice

S

shapper

Hello,

I am working on an ASP.NET MVC web site with SQL 2008.
I need to upload a files to the server.
My approach at the moment is to save the files on a folder and save
the path on a SQL table.

But I am thinking on saving the files directly on the SQL 2008
database.
I am mostly saving images and pdf's.

I know SQL 2008 has a new file type.

I am using C#. Saving the files on the database is a good approach.
How should I do this?

Thanks,
Miguel
 
A

Arne Vajhøj

shapper said:
I am working on an ASP.NET MVC web site with SQL 2008.
I need to upload a files to the server.
My approach at the moment is to save the files on a folder and save
the path on a SQL table.

But I am thinking on saving the files directly on the SQL 2008
database.
I am mostly saving images and pdf's.

I know SQL 2008 has a new file type.

I am using C#. Saving the files on the database is a good approach.
How should I do this?

I would just use IMAGE column type and plain ADO.NET (SqlCommand).

Storing the files in the database requires some power of the
database server but is easier to manage than just storing
paths in the database and content in the file system.

Arne
 
S

shapper

I would just use IMAGE column type and plain ADO.NET (SqlCommand).

Storing the files in the database requires some power of the
database server but is easier to manage than just storing
paths in the database and content in the file system.

Arne

I am considering using the new FileSystem of SQL 2008:
http://msdn.microsoft.com/en-us/library/cc949109.aspx

And can I insert a record using Linq getting the data from a model in
my C# code?
What would be the # data type for the file in my model that would be
placed on the FileSystem column.

Does anyone knows such an example?

I read something like this a few weeks ago but I lost the url and I
can't find it anywhere.

Thanks,
Miguel
 
A

Arne Vajhøj

shapper said:
I am considering using the new FileSystem of SQL 2008:
http://msdn.microsoft.com/en-us/library/cc949109.aspx

And can I insert a record using Linq getting the data from a model in
my C# code?
What would be the # data type for the file in my model that would be
placed on the FileSystem column.

Does anyone knows such an example?

I read something like this a few weeks ago but I lost the url and I
can't find it anywhere.

I do not know anything about the new FILESTREAM thingy.

I would not use LINQ because ORM is not good for LOB's.

I assume you will have a byte[] in C#.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top