.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Need to export images from a varbinary column to .jpg files (SQL 2K)

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server


What's an efficient way to export the images out of a table (SQL 2000) which has them stored in a varbinary column -- i.e. export from image data to .jpg file?

Can I do this using an ODBC connection?



View Complete Post

More Related Resource Links

The ASP Column: What's in ASP.NET Config Files?


Even though you've been using ASP. NET for a while, how much do you really know about ASP. NET configuration files? While you've probably touched the Web. config file from time to time, there are some nuances involved in configuring ASP.

George Shepherd

MSDN Magazine September 2004

In export, i want to disable column in excel sheet

Hello, I am doing Import/Export. While export i want to disable some column in excel sheet, so during upload or import same primary key I can use, instead of user modify such column. Regards, Sandeep    

ssis sql 2000 image to 2008 varbinary Failed to retrieve long data for column

Hi, I have a task that to migrate the image type column from sql 2000 to varbinary type in sql 2008. The source column having 3812353 max datalength size for the column. The package always failed with following error message. [OLE DB Source [13177]] Error: Failed to retrieve long data for column "attch_file_content_t". [OLE DB Source [13177]] Error: There was an error with output column "attch_file_content_t" (13209) on output "OLE DB Source Output" (13187). The column status returned was: "DBSTATUS_UNAVAILABLE". [OLE DB Source [13177]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "attch_file_content_t" (13209)" failed because error code 0xC0209071 occurred, and the error row disposition on "output column "attch_file_content_t" (13209)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. Meng Chew

XPS Export with images problem.

Hi, I have a drawing pad which is a Canvas which shapes can be added to in the form of Windows.Shapes.Shape.  These get drawn by overriding the DefiningGeometry property and setting the shapes values there. For images this looks like this Public Overrides Function Draw() As Geometry If Me.Pen.Thickness = 0 Then Return Nothing Dim rf As Rect = ReturnFixedRectangle() Me.Fill = Me.ImageBrush Dim mt As New MatrixTransform(Me.Matrix) m_rectangle.Rect = rf Me.VisualTransform = mt Return m_rectangle End Function Where Me.ImageBrush is Public Property ImageBrush() As ImageBrush Get If m_imageBrush Is Nothing Then m_bitmapStream = New System.IO.MemoryStream m_bitmapStream.Write(Me.ImageBytes, 0, Me.ImageBytes.Length) m_bitmapStream.Seek(0, IO.SeekOrigin.Begin) m_frame = System.Windows.Media.Imaging.BitmapFrame.Create(m_bitmapStream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad) m_aspectRatio = m_frame.Width / m_frame.Height m_imageBrush = New ImageBrush(m_frame) m_imageBrush.Stretch = Windows.Media.Stretch.Fill m_imageBrush.TileMode = TileMode.None m_imageBrush.Freeze() m_bitmapStream.Close() End If Return m_imageBrush End Get Set(ByVal value As ImageBrush) m_imageBrush =

Sharepoint Calendar export to Outlook but can only view the Title column

I have created a Calendar in Sharepoint for booking out company vehicles. The fields I have created are: Vehicle (Choice), Driver (User/Group), Start & End Times, Title (text), DisplayField (Calculated text based on Vehicle + Title...... it would be nice to include Driver but it seems Sharepoint cannot handle the User/Group datatype in a calculated field.....but I digress). I use the DisplayField calculated field in my default calendar view in Sharepoint. All is good at this point. When one connects it to Outlook (via the Action menu in Sharepoint) the calendar is added but all the entries show only the Title field. If I double click on an entry, only the title field appears - the Vehicle and Driver values are missing. When I try to create a new entry - only the Title field (plus other default Outlook fields) are available. So: How can one display a value other than Title by default, and how can I display the other columns when looking at the event detail?

ASP.NET-Gridview - Export to excel- column format

Hi All, I am exporting gridview data into excel sheet. I have a column  which is a code for which data is like 012,013 etc. But when this data is being exported , in the excel sheet I can see the data as 12,13,14. but actually it should be 012.... Is there any way to specify the format of such columns in my datatable so that they are in the same manner as in the database? Please provide some information on this.Thanks in advance.

Deleting row with varbinary(max) column from a .Net web app causes a timeout

Hi, We've got a .Net web app with a table called CoreFile. The table has a PK called FileID and a varbinary(max) column called FileData, amount other columns. The table holds small files, most of which are below 100kb, but with the odd 1.5-2mb file. I don’t believe there is anything above 10mb. We have a stored procedure that deletes an individual entry: DELETE FROM CoreFile WHERE FileID = @FileID The problem is that when the SP is executed from the web app, the connection times out and the delete is unsuccessful, particularly when the file is larger. The specific error is: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. When we execute the SP from SSMS however, the statement runs almost instantly, regardless of the file size. I checked the connection settings using the SQL Server Profiler, and both SSMS and the web app appear to use the same configuration: -- network protocol: TCP/IP set quoted_identifier on set arithabort off set numeric_roundabort off set ansi_warnings on set ansi_padding on set ansi_nulls on set concat_null_yields_null on set cursor_close_on_commit off set implicit_transactions off set language British set dateformat dmy set datefirst 1 set transaction isolation level read committed I tried replacing the SP with a LINQ statement using the Entity Fram

SSRS Word Export Issue- Last Column Data getting Trim


We are exporting a SSRS report in Word. The last colum is getting displayed without its right side vertical bar. Data is also getting trim. Please let us know the solution on this.


Is it possible to save "Collections" to a single varbinary(MAX) field/column in a SQL Server 2008 da


I was thinking about the fastest way to retrieve a "set" of objects related to a specific user. For instance, if I was to create a website similar to Flickr where people upload lots and lots of photos(jpegs) what would be the fastest way to be able to retrieve those photos from the SQL Server database. Scenario 1: You store metadata about each file they upload to the website as a single row in a database table. Then when you want to retrieve a specific users uploaded files you simply scan the database file for every row matching the UserID and store them in memory.

SELECT PictureId, UserId, PathToFile, Caption, (etc.)

FROM Photos

WHERE UserId=@UserId

This, of course, gets all the information about all the photos a single user has uploaded. My concern with this approach is when the user activity goes from a few thousand to being in excess of a million.

This approach seems fine for a small website but does this method work for a million plus user website like Flicker or MySpace? When you have a million users and millions more photos does this approach still perform at acceptable speeds?

My idea was to actually attempt to create a collection in memory of "ALL" the PictureIds' for a single user and store them in-memory, in a collection and then save this collection as a single VARBINARY(MAX) field in the SQL

SSRS report export to CSV showing column headers always in English inspite of the selected locale.


We are encoutering an issue with SSRS report export to CSV showing column headers always in English, regardless of locale.


We are using SSRS to display report results in a report viewer window launched from an ASP.net page.


When the report viewer is lauched in fr-CA locale, the report viewer window content is in French. However, when the results are exported to CSV, all the column header labels inside the CSV are always in English.


Export to Excel big size files (10000 pages) - HTTP Error 401.1



If you attempt to export a file to Excel, the browser hangs for a long time, then begins to request authorization, several times in succession .
Then displays an error message: "you are not authorized to view this page"

Variation export doesnot generate all the XML files



We have one site which have around 25 variations sites.

Now when we create export of a variation first time just after creating it then the export file(.cmp) contains 9 XML files, as just after creating variation all the pages are in draft version 0.1.

Now if we publish all the pages and now again we chekout and check in all the pages to 1.1 draft version then we create export file we didnt get 9 XML Files. This time it contains only 3 XML files.

9 XML files are required for translating the files.

Can anyone tell me the reason for the missing XML files.


Note : We are creating export using Sharepoint UI from Site Content and Management.


Jasjeet Singh

Do I dispose() of images I read in from resource files?


Sorry that this is such a basic noob question.

I store many images in several resource files attached to my projects and read them in when I need them using resourcemanagers.

I've been looking through my code and found a place where I store all the images in a List<Image> and just clear() it when I need to load up a new set of images.

Should I be calling Dispose() on each one of these images first? I suddenly realized I didn't know if I was using references to images in the files, or whether a completely new image was being created using data from the resource file.


Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend