Click here to Skip to main content
15,911,141 members
Home / Discussions / Database
   

Database

 
General.Net portal Pin
Madhuri Mittal1-Apr-03 12:18
Madhuri Mittal1-Apr-03 12:18 
GeneralRe: .Net portal Pin
Nick Parker1-Apr-03 12:26
protectorNick Parker1-Apr-03 12:26 
QuestionCreating MS Access Database? Pin
BM_CSharp1-Apr-03 11:07
sussBM_CSharp1-Apr-03 11:07 
AnswerRe: Creating MS Access Database? Pin
Wayne Phipps2-Apr-03 8:17
Wayne Phipps2-Apr-03 8:17 
GeneralDatabaseconnection Pin
Herm31-Mar-03 19:11
Herm31-Mar-03 19:11 
GeneralFilling a dataset in another Thread Pin
Shisong Chen31-Mar-03 7:56
Shisong Chen31-Mar-03 7:56 
GeneralStored Procedure, OUTPUT param and (n)text Pin
Paul Watson31-Mar-03 5:47
sitebuilderPaul Watson31-Mar-03 5:47 
GeneralRe: Stored Procedure, OUTPUT param and (n)text Pin
Stan Shannon31-Mar-03 7:43
Stan Shannon31-Mar-03 7:43 
We store large image files in our db. I've been using this technique to extract them:

CREATE PROCEDURE locSP_OpenBlob( @idsd_file uniqueidentifier )
AS
begin

SELECT

	sd_file.data

	from  sd_file 
	WHERE sd_file.idsd_file	= @idsd_file

end

GO


Where sd_file.data is defined as an "image" type in the table.

on the Client side (using C#) I use a DataReader


MemoryStream st = new MemoryStream();
BinaryWriter bw = new BinaryWriter( st,System.Text.Encoding.Default );
while(( retval  = datareader.GetBytes(0, len, outbyte, 0, bufferSize )) > 0 )
{
    bw.Write( outbyte );
    bw.Flush();
    len += retval;
}


I don't know if that is the best way or not, but it seems to work well enough for our purposes...

"My job is to protect America"

George W. Bush.
GeneralRe: Stored Procedure, OUTPUT param and (n)text Pin
Paul Watson31-Mar-03 7:48
sitebuilderPaul Watson31-Mar-03 7:48 
GeneralRe: Stored Procedure, OUTPUT param and (n)text Pin
Stan Shannon31-Mar-03 8:19
Stan Shannon31-Mar-03 8:19 
GeneralRe: Stored Procedure, OUTPUT param and (n)text Pin
Bruce Duncan31-Mar-03 7:43
Bruce Duncan31-Mar-03 7:43 
GeneralRe: Stored Procedure, OUTPUT param and (n)text Pin
Paul Watson31-Mar-03 7:51
sitebuilderPaul Watson31-Mar-03 7:51 
GeneralRe: Stored Procedure, OUTPUT param and (n)text Pin
Bruce Duncan31-Mar-03 8:10
Bruce Duncan31-Mar-03 8:10 
QuestionCan I retrieve column names using MFC classes Pin
Charles Liu30-Mar-03 18:42
Charles Liu30-Mar-03 18:42 
AnswerRe: Can I retrieve column names using MFC classes Pin
DiWa30-Mar-03 20:23
DiWa30-Mar-03 20:23 
AnswerRe: Can I retrieve column names using MFC classes Pin
tomiczek31-Mar-03 23:49
tomiczek31-Mar-03 23:49 
GeneralRe: Can I retrieve column names using MFC classes Pin
Charles Liu1-Apr-03 16:38
Charles Liu1-Apr-03 16:38 
GeneralRe: Can I retrieve column names using MFC classes Pin
DiWa2-Apr-03 1:39
DiWa2-Apr-03 1:39 
GeneralConnection string Pin
Hesham Amin29-Mar-03 9:21
Hesham Amin29-Mar-03 9:21 
GeneralGot it !! Pin
Hesham Amin30-Mar-03 21:43
Hesham Amin30-Mar-03 21:43 
GeneralRe: Connection string Pin
wangzhibin6-Apr-03 15:11
wangzhibin6-Apr-03 15:11 
GeneralRe: Connection string Pin
Hesham Amin6-Apr-03 21:16
Hesham Amin6-Apr-03 21:16 
GeneralBtrieve Owner Name Pin
Andy H28-Mar-03 9:36
Andy H28-Mar-03 9:36 
GeneralDuring inserting records to the database, sometimes a blank record appears in the database.But none of records I insert is blank. Pin
stanley guan27-Mar-03 14:33
stanley guan27-Mar-03 14:33 
GeneralODBC Pin
blink4me27-Mar-03 11:37
blink4me27-Mar-03 11:37 

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.