Saving Word File into SQL Server
-
Hello friends, My idea is given below. While clicking a button, mas-word should open within the browser with an existing Template file (.dot). After typing its contents and clicking save button, it will come back to the aspx page. Then I will fill other details of the file in aspx page and finally click Submit. Then the word file should be saved into SQL server table. I should be able to open that word file later from SQL server table itself. Can anybody give the code for this logic Regards Shivan
Shivanandan C V
-
Hello friends, My idea is given below. While clicking a button, mas-word should open within the browser with an existing Template file (.dot). After typing its contents and clicking save button, it will come back to the aspx page. Then I will fill other details of the file in aspx page and finally click Submit. Then the word file should be saved into SQL server table. I should be able to open that word file later from SQL server table itself. Can anybody give the code for this logic Regards Shivan
Shivanandan C V
My Suggestion, Never store files on SQL Server, Stored files on Hard Drive and Store the path into Table , retrieve the files name from database and open the file from corresponding path !!
cheers, Abhijit
-
Hello friends, My idea is given below. While clicking a button, mas-word should open within the browser with an existing Template file (.dot). After typing its contents and clicking save button, it will come back to the aspx page. Then I will fill other details of the file in aspx page and finally click Submit. Then the word file should be saved into SQL server table. I should be able to open that word file later from SQL server table itself. Can anybody give the code for this logic Regards Shivan
Shivanandan C V
Shivan Nandan wrote:
While clicking a button, mas-word should open within the browser with an existing Template file (.dot).
That's not possible in web application. You have to provide an option for user to download the template file. Let them fill it and come back to your webpage for uploading it.
Shivan Nandan wrote:
hen the word file should be saved into SQL server table.
Try to avoid keeping files in SQL server unless there is a strong need for that. Keep the file in server HDD and store the path in database. Files are kept in SQL server database in BLOB fields. You have to use
varbinary(max)
type.Navaneeth How to use google | Ask smart questions
-
Hello friends, My idea is given below. While clicking a button, mas-word should open within the browser with an existing Template file (.dot). After typing its contents and clicking save button, it will come back to the aspx page. Then I will fill other details of the file in aspx page and finally click Submit. Then the word file should be saved into SQL server table. I should be able to open that word file later from SQL server table itself. Can anybody give the code for this logic Regards Shivan
Shivanandan C V
Shivan Nandan wrote:
Then the word file should be saved into SQL server table
Although there are different opinions whether this should be done or not, if you still consider storing the data into the database, perhaps this would help: http://www.codeproject.com/KB/database/SqlFileStream.aspx[^]
The need to optimize rises from a bad design.My articles[^]
-
Shivan Nandan wrote:
While clicking a button, mas-word should open within the browser with an existing Template file (.dot).
That's not possible in web application. You have to provide an option for user to download the template file. Let them fill it and come back to your webpage for uploading it.
Shivan Nandan wrote:
hen the word file should be saved into SQL server table.
Try to avoid keeping files in SQL server unless there is a strong need for that. Keep the file in server HDD and store the path in database. Files are kept in SQL server database in BLOB fields. You have to use
varbinary(max)
type.Navaneeth How to use google | Ask smart questions
-
N a v a n e e t h wrote:
Try to avoid keeping files in SQL server unless there is a strong need for that
Just for curiosity, why not to store the documents into SQL Server.
The need to optimize rises from a bad design.My articles[^]
That realy depends. I felt difficulties to manage the files which are kept in database. On a shared hosting, you will have limited database space and more HDD space. So keeping files in database will increase DB size and you will run out of the limit easily. For accessing the file, you need to query the database, and write to response with correct content type. If the file is in HDD, you only have to take the file path from DB and redirect to it. Since files are stored in
varbinary
column, I think no SQL functions can be applied to it. So IMO it is pointless. Please correct me if I am wrong :)Navaneeth How to use google | Ask smart questions