Solved

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

Posted on 2008-06-10
3
7,423 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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.

803 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