Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
C#
// Save the document to a MemoryStream object.
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);

string fileName = Path.GetFileName(doc.OriginalFileName);

// Create the SQL command.
row.Cells[1].Value =stream.ToArray(;

// Add the @Doc parameter.
command.Parameters.AddWithValue("Doc", stream.ToArray());

// Write the document to the database.
command.ExecuteNonQuery();
Posted
Updated 13-Jun-14 22:23pm
v2
Comments
MayurDighe 14-Jun-14 17:38pm    
Improve your Question...??
Provide more information about Problem Statement you have.

1 solution

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900