Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Citrix XenDesktop, gold image, VMware, vSphere.
#Citrix #XenApp #Citrix Scout #Citrix Insight Services #Microsoft VMMAP #Microsoft ADEXPLORE #Microsoft RAMMAP #Microsoft TCPVIEW #Microsoft AUTORUNS #Microsoft PROCESS EXPLORER #Microsoft PROCESS MONITOR
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now