Click here to Skip to main content
15,920,801 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get pixel value in colored image in c# [modified] Pin
Natza Mitzi29-Mar-09 19:38
Natza Mitzi29-Mar-09 19:38 
GeneralRe: How to get pixel value in colored image in c# Pin
Christian Graus29-Mar-09 19:42
protectorChristian Graus29-Mar-09 19:42 
AnswerRe: How to get pixel value in colored image in c# Pin
Xmen Real 29-Mar-09 19:47
professional Xmen Real 29-Mar-09 19:47 
QuestionHow to convert flat files to XML using c# Pin
SK8429-Mar-09 14:57
SK8429-Mar-09 14:57 
AnswerRe: How to convert flat files to XML using c# Pin
Christian Graus29-Mar-09 19:40
protectorChristian Graus29-Mar-09 19:40 
GeneralRe: How to convert flat files to XML using c# Pin
Pete O'Hanlon29-Mar-09 23:38
mvePete O'Hanlon29-Mar-09 23:38 
GeneralRe: How to convert flat files to XML using c# Pin
Dan Neely30-Mar-09 2:43
Dan Neely30-Mar-09 2:43 
QuestionCommandBehavior.SequentialAccess (SqlDataReader) Pin
Jacob Dixon29-Mar-09 14:55
Jacob Dixon29-Mar-09 14:55 
Can you use CommandBehavior.SequentialAccess with data in a VARBINARY column?

I have a downloads pulling from that column but not doing it that way.... here is my code:

int bytesSize = 0;
                    byte[] downBuffer = new byte[1024];

                    byte[] buffer = (byte[])cmd.ExecuteScalar();
                    conn.Close();
                    
                    MemoryStream ms = new MemoryStream(buffer);
                    FileStream fs = new FileStream(Path, FileMode.Create, FileAccess.ReadWrite);

                    while ((bytesSize = ms.Read(downBuffer, 0, downBuffer.Length)) > 0)
                    {
                        fs.Write(downBuffer, 0, bytesSize);
                        WriteTextBox((fs.Length / 1024) + "KB of " + (ms.Length / 1024) + "KB.");
                        bw.ReportProgress(Convert.ToInt32((fs.Length * 100) / ms.Length));
                    }

                    fs.Close();
                    ms.Close();


The problem is it gets all the data here:
byte[] buffer = (byte[])cmd.ExecuteScalar();


So if I'm correct it is getting ALL of the data there. Which if it is a large file.. not even that large, it pauses there until it gets it.. Now on remote connections it times out because it doesn't have that long. But also the way I have it reports progress when writing to the file, but I want to report progress on downloading the file.

I have seen code used with this for BLOB data, but the column is not the type TEXT.
AnswerRe: CommandBehavior.SequentialAccess (SqlDataReader) Pin
N a v a n e e t h29-Mar-09 17:38
N a v a n e e t h29-Mar-09 17:38 
QuestionSql query designer Pin
Dushan12329-Mar-09 14:12
Dushan12329-Mar-09 14:12 
AnswerRe: Sql query designer Pin
Natza Mitzi29-Mar-09 19:42
Natza Mitzi29-Mar-09 19:42 
QuestionWhen Adding A Control, what events fire? [modified] Pin
Duraplex29-Mar-09 13:09
Duraplex29-Mar-09 13:09 
AnswerRe: When Adding A Control, what events fire? Pin
maxatlis30-Mar-09 7:00
maxatlis30-Mar-09 7:00 
GeneralRe: When Adding A Control, what events fire? Pin
Duraplex30-Mar-09 11:47
Duraplex30-Mar-09 11:47 
Question%SystemRoot%\Microsoft.NET\Framework\ Pin
Mohammad Dayyan29-Mar-09 6:49
Mohammad Dayyan29-Mar-09 6:49 
AnswerRe: %SystemRoot%\Microsoft.NET\Framework\ Pin
Giorgi Dalakishvili29-Mar-09 7:00
mentorGiorgi Dalakishvili29-Mar-09 7:00 
GeneralRe: %SystemRoot%\Microsoft.NET\Framework\ PinPopular
PIEBALDconsult29-Mar-09 7:15
mvePIEBALDconsult29-Mar-09 7:15 
GeneralRe: %SystemRoot%\Microsoft.NET\Framework\ Pin
Giorgi Dalakishvili29-Mar-09 7:23
mentorGiorgi Dalakishvili29-Mar-09 7:23 
AnswerRe: %SystemRoot%\Microsoft.NET\Framework\ [modified] Pin
Alan N29-Mar-09 14:07
Alan N29-Mar-09 14:07 
QuestionC# Windows Application problem Pin
cheese_29-Mar-09 5:23
cheese_29-Mar-09 5:23 
AnswerRe: C# Windows Application problem Pin
JF201529-Mar-09 5:41
JF201529-Mar-09 5:41 
AnswerRe: C# Windows Application problem Pin
Luc Pattyn29-Mar-09 6:28
sitebuilderLuc Pattyn29-Mar-09 6:28 
AnswerRe: C# Windows Application problem Pin
BinShao29-Mar-09 15:41
BinShao29-Mar-09 15:41 
QuestionGetting data from a web page Pin
nike_arh29-Mar-09 4:07
nike_arh29-Mar-09 4:07 
AnswerRe: Getting data from a web page Pin
Xmen Real 29-Mar-09 4:26
professional Xmen Real 29-Mar-09 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.