Solved

saving binary data in sql server 2005 using varbinary(max)

Posted on 2008-06-10
3
7,425 Views
Last Modified: 2011-06-17
I want to save documents in sql server 2005 and only by using varbinary(max) as datatype. I am working on C# winform application.
0
Comment
Question by:shore-support
3 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 21759093
u can read documnets as raw file

byte[]bytes = System.IO.File.ReadAllBytes(Filename);

then using a command object

Command.CommandText = "insert into table (...,varmaxfield) values(.....,@varmaxvalue)";

Command.Parameters.AddWithValue(@varmaxvalue,bytes);

Command.ExecuteNonquery();
0
 

Author Comment

by:shore-support
ID: 35988536
abandoned qustion
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question