Click here to Skip to main content
13,295,448 members (50,658 online)
Rate this:
Please Sign up or sign in to vote.
See more:
program for inserting a word file content in sql server 2005 database
Posted 24-Jan-13 23:58pm
Rahul Dhoble 25-Jan-13 5:14am
Hello jalbaji ,
As this member suggested answer for your question which is correct . Please accept his solution, vote it and mark your question as 'SOLVED'

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

byte[] data = File.ReadAllBytes(pathToFile);
using (SqlConnection con = new SqlConnection(strConnect))
    using (SqlCommand com = new SqlCommand("INSERT INTO myTable (myColumn) VALUES (@C1)", con))
        com.Parameters.AddWithValue("@C1", data);
Rahul Dhoble 25-Jan-13 5:13am
Good answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100