Click here to Skip to main content
15,900,378 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL query builder from an App Pin
Leyu6-Jun-05 5:59
Leyu6-Jun-05 5:59 
GeneralRe: SQL query builder from an App Pin
niansah6-Jun-05 23:41
niansah6-Jun-05 23:41 
GeneralLoads of problems in VB .net Pin
Mega14-Jun-05 18:57
Mega14-Jun-05 18:57 
GeneralRe: Loads of problems in VB .net Pin
Colin Angus Mackay5-Jun-05 0:16
Colin Angus Mackay5-Jun-05 0:16 
GeneralRe: Loads of problems in VB .net Pin
Luis Alonso Ramos6-Jun-05 7:10
Luis Alonso Ramos6-Jun-05 7:10 
QuestionHow it is showing name of owner different than actual in sql server2000 Pin
under28113-Jun-05 17:51
under28113-Jun-05 17:51 
GeneralImage in SQL Server 2000 Pin
Dino Sousa3-Jun-05 12:34
Dino Sousa3-Jun-05 12:34 
GeneralRe: Image in SQL Server 2000 Pin
zhengdong jin5-Jun-05 8:55
zhengdong jin5-Jun-05 8:55 
Smile | :) 1 you can create a proc first like:

create proc p_pic_i
@filename nvarchar(100),
@filesize int,
@jpgdate image
as
insert into pic (
filename,
filesize,
filedata)
values (
@filename,
@filesize,
@filedata)

if @@rowcount = 1 and @@error = 0
return @@identity
else
return -1
go

2 then write a function to call this proc, sorry this is c# not vb.net

public int csf_p_News_ext_i(
string filename,
int filesize,
byte[] filedata,
SqlConnection conn)
{
SqlCommand cmd = new SqlCommand("p_News_ext_i",conn);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add("@RETURN_VALUE",SqlDbType.Int,4);
cmd.Parameters["@RETURN_VALUE"].Direction =
ParameterDirection.ReturnValue;

cmd.Parameters.Add("@filename",SqlDbType.NVarChar,200);
cmd.Parameters["@filename"].Value = filename;

cmd.Parameters.Add("@filesize",SqlDbType.Int,4);
cmd.Parameters["@filesize"].Value = filesize;

cmd.Parameters.Add("@filedata",SqlDbType.Image);
cmd.Parameters["@filedata"].Value = filedata;

int retvar = -1;

try
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
retvar = (int)cmd.Parameters["@RETURN_VALUE"].Value;
}
catch
{
retvar = -1;
}
return retvar;
}

3 read stream(asp.net)
Byte[] FileByteArray = new Byte[filelength];
Stream StreamObject = UpFile.InputStream;
StreamObject.Read(FileByteArray,0,filelength);

GeneralRe: Image in SQL Server 2000 Pin
Dino Sousa5-Jun-05 12:51
Dino Sousa5-Jun-05 12:51 
GeneralRe: Image in SQL Server 2000 Pin
zhengdong jin8-Jun-05 7:29
zhengdong jin8-Jun-05 7:29 
GeneralCreating a Access Database from SQL statements in C# Pin
Wilye3-Jun-05 11:05
Wilye3-Jun-05 11:05 
GeneralTransfering of files and folders Pin
Anonymous3-Jun-05 2:48
Anonymous3-Jun-05 2:48 
GeneralRe: Transfering of files and folders Pin
Colin Angus Mackay3-Jun-05 4:29
Colin Angus Mackay3-Jun-05 4:29 
QuestionIDispatch, ADORecordset and Property loss?!? Pin
almc3-Jun-05 0:54
almc3-Jun-05 0:54 
QuestionSQL DateTime average function? Pin
devvvy3-Jun-05 0:31
devvvy3-Jun-05 0:31 
AnswerRe: SQL DateTime average function? Pin
toxcct3-Jun-05 3:35
toxcct3-Jun-05 3:35 
AnswerRe: SQL DateTime average function? Pin
oykica6-Jun-05 7:32
oykica6-Jun-05 7:32 
Generalcurrency convertor Pin
Virendrak2-Jun-05 21:57
Virendrak2-Jun-05 21:57 
GeneralRe: currency convertor Pin
Colin Angus Mackay2-Jun-05 22:21
Colin Angus Mackay2-Jun-05 22:21 
GeneralRe: currency convertor Pin
Yulianto.2-Jun-05 22:53
Yulianto.2-Jun-05 22:53 
GeneralRe: currency convertor Pin
Kareem Shaker4-Jun-05 23:20
Kareem Shaker4-Jun-05 23:20 
GeneralOleDB Problem Pin
Saksida Bojan2-Jun-05 20:16
Saksida Bojan2-Jun-05 20:16 
GeneralRe: OleDB Problem Pin
Yulianto.2-Jun-05 22:58
Yulianto.2-Jun-05 22:58 
GeneralRe: OleDB Problem Pin
Saksida Bojan3-Jun-05 5:16
Saksida Bojan3-Jun-05 5:16 
GeneralSet up mail account for reporting services Pin
PaulCurry2-Jun-05 14:56
PaulCurry2-Jun-05 14:56 

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.