Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
QuestionWebclient.DownloadFilesAsync issue Pin
Reason Man3-Jul-08 4:17
Reason Man3-Jul-08 4:17 
AnswerRe: Webclient.DownloadFilesAsync issue Pin
Michael90003-Jul-08 8:03
Michael90003-Jul-08 8:03 
AnswerRe: Webclient.DownloadFilesAsync issue Pin
Anthony Mushrow3-Jul-08 8:34
professionalAnthony Mushrow3-Jul-08 8:34 
QuestionC# Save data from DB (BLOB) Problem ... 1Kb is missing [modified] Pin
countnazgul3-Jul-08 4:13
countnazgul3-Jul-08 4:13 
AnswerRe: C# Save data from DB (BLOB) Problem ... 1Kb is missing Pin
leppie3-Jul-08 4:34
leppie3-Jul-08 4:34 
GeneralRe: C# Save data from DB (BLOB) Problem ... 1Kb is missing Pin
countnazgul3-Jul-08 4:45
countnazgul3-Jul-08 4:45 
AnswerRe: C# Save data from DB (BLOB) Problem ... 1Kb is missing Pin
half-life3-Jul-08 6:21
half-life3-Jul-08 6:21 
GeneralRe: C# Save data from DB (BLOB) Problem ... 1Kb is missing Pin
countnazgul3-Jul-08 9:22
countnazgul3-Jul-08 9:22 
Yes file was OK.
But i find another solution that extract my files without a problem.
Here is and the code:
MySqlConnection Conn = new MySqlConnection("SERVER=localhost;" +
"DATABASE=db;" +
"UID=user;" +
"PASSWORD=root;");

MySqlCommand Cmd = new MySqlCommand("Select * From test where id = 19", Conn);
Cmd.CommandType = CommandType.Text;
Conn.Open();
MySqlDataReader Reader = Cmd.ExecuteReader(CommandBehavior.CloseConnection);
FileStream FStream = null;
BinaryWriter BWriter = null;

byte[] Binary = null;
const int ChunkSize = 100;
int SizeToWrite = 0;
MemoryStream MStream = null;

while (Reader.Read())
{
    FStream = new FileStream(@"c:\Data\Nomenclature123.xls", FileMode.OpenOrCreate, FileAccess.Write);
    BWriter = new BinaryWriter(FStream);
    Binary = (Reader["blobdata"]) as byte[];
    SizeToWrite = ChunkSize;
    MStream = new MemoryStream(Binary);

    for (int i = 0; i < Binary.GetUpperBound(0) - 1; i = i + ChunkSize)
    {
        if (i + ChunkSize >= Binary.Length) SizeToWrite = Binary.Length - i;
        byte[] Chunk = new byte[SizeToWrite];
        MStream.Read(Chunk, 0, SizeToWrite);
        BWriter.Write(Chunk);
        BWriter.Flush();
    }
    BWriter.Close();
    FStream.Close();
}
FStream.Dispose();


Thank You gays for responses!

King Regards!
countNazgul

GeneralRe: C# Save data from DB (BLOB) Problem ... 1Kb is missing Pin
leppie3-Jul-08 22:46
leppie3-Jul-08 22:46 
QuestionPlease Help. Can anyone help me connect to a User-Autheticated ( Using AD ) Sharepoint site? Pin
AlexanderTheGreat073-Jul-08 4:09
AlexanderTheGreat073-Jul-08 4:09 
QuestionPrinting a windows form Pin
Nath3-Jul-08 3:28
Nath3-Jul-08 3:28 
AnswerRe: Printing a windows form Pin
Kristian Sixhøj3-Jul-08 3:44
Kristian Sixhøj3-Jul-08 3:44 
GeneralRe: Printing a windows form Pin
Nath4-Jul-08 20:28
Nath4-Jul-08 20:28 
Questionlost selection problem on mouse click in DataGridView Pin
Xmen Real 3-Jul-08 3:08
professional Xmen Real 3-Jul-08 3:08 
AnswerRe: lost selection problem on mouse click in DataGridView Pin
leppie3-Jul-08 3:56
leppie3-Jul-08 3:56 
GeneralRe: lost selection problem on mouse click in DataGridView Pin
Xmen Real 3-Jul-08 8:21
professional Xmen Real 3-Jul-08 8:21 
Questionfilesystemwatcher Pin
arkiboys3-Jul-08 2:37
arkiboys3-Jul-08 2:37 
AnswerRe: filesystemwatcher Pin
Xmen Real 3-Jul-08 2:56
professional Xmen Real 3-Jul-08 2:56 
QuestionI want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? Pin
sri_00993-Jul-08 2:34
sri_00993-Jul-08 2:34 
AnswerRe: I want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? PinPopular
leppie3-Jul-08 3:54
leppie3-Jul-08 3:54 
AnswerRe: I want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? Pin
leppie3-Jul-08 4:05
leppie3-Jul-08 4:05 
GeneralRe: I want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? Pin
sri_00993-Jul-08 4:15
sri_00993-Jul-08 4:15 
GeneralRe: I want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? Pin
leppie3-Jul-08 4:31
leppie3-Jul-08 4:31 
AnswerRe: I want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? Pin
Dan Neely3-Jul-08 5:52
Dan Neely3-Jul-08 5:52 
AnswerRe: I want to implement the Linked list, hash table functionality in .NET without using the standard inbuilt classes assuming they are not present.How Can I achieve this? Pin
User 66583-Jul-08 6:07
User 66583-Jul-08 6:07 

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.