Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-10
3
Medium Priority
?
7,433 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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.

719 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