Click here to Skip to main content
15,909,741 members
Home / Discussions / Database
   

Database

 
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Mike Dimmick10-Dec-04 2:28
Mike Dimmick10-Dec-04 2:28 
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango10-Dec-04 4:29
sponsorJudah Gabriel Himango10-Dec-04 4:29 
AnswerRe: Server -- keep connection open? Or open/close as needed? Pin
Dave Kreskowiak10-Dec-04 9:56
mveDave Kreskowiak10-Dec-04 9:56 
GeneralRe: Server -- keep connection open? Or open/close as needed? Pin
Judah Gabriel Himango10-Dec-04 10:00
sponsorJudah Gabriel Himango10-Dec-04 10:00 
GeneralStored Procedure using Disconnected Recordset Pin
web_app_developer9-Dec-04 4:00
web_app_developer9-Dec-04 4:00 
GeneralRe: Stored Procedure using Disconnected Recordset Pin
tojamismis10-Dec-04 12:42
tojamismis10-Dec-04 12:42 
GeneralSQL Server 2000 / Access Pin
| Muhammad Waqas Butt |9-Dec-04 1:08
professional| Muhammad Waqas Butt |9-Dec-04 1:08 
GeneralInsert photos and files Pin
CNU8-Dec-04 14:46
CNU8-Dec-04 14:46 
Hi,
I am a newbie to SQL and all I know is insert, delete and update Smile | :)

I have to upload some resources (images and files) to the database. For this purpose I have created a column with datatype varbinary and length 8000.
But I have some problems in this process :

1. Is there any way that we can upload files of size more then 8000 ?
2. I tried uploading a file of size 2393 KB on disk. But I get the following error:
System.Data.SqlClient.SqlException: Cannot create a row of size 8077 which is greater than the allowable maximum of 8060.
This is how I create the byte array :

FileStream fs = new FileStream(aFilePath, FileMode.Open);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, (int)fs.Length );
fs.Close();

this is how I upload to db :

SqlParameter sqlParam = new SqlParameter("@" + fieldName, sqlDbType.VarBinary, 8000);
sqlParam.Value = buffer;
mySqlCommand.Add(sqlParam);
mySqlCommand.ExecuteNonQuery();

Sorry, the above code is in bits and pieces since I cannot put all here...
Please help me...




Cheers
CNU
GeneralRe: Insert photos and files Pin
Alex Korchemniy8-Dec-04 16:55
Alex Korchemniy8-Dec-04 16:55 
GeneralRe: Insert photos and files Pin
CNU8-Dec-04 17:39
CNU8-Dec-04 17:39 
GeneralRe: Insert photos and files Pin
Alex Korchemniy9-Dec-04 10:53
Alex Korchemniy9-Dec-04 10:53 
GeneralRe: Insert photos and files Pin
Mekong River9-Dec-04 4:18
Mekong River9-Dec-04 4:18 
GeneralSQL query Pin
Paps28-Dec-04 3:49
Paps28-Dec-04 3:49 
GeneralRe: SQL query Pin
Yulianto.8-Dec-04 15:58
Yulianto.8-Dec-04 15:58 
GeneralRe: SQL query Pin
Alex Korchemniy8-Dec-04 17:02
Alex Korchemniy8-Dec-04 17:02 
GeneralRunning Batch Files - Windows Pin
sweep1237-Dec-04 22:24
sweep1237-Dec-04 22:24 
GeneralRe: Accessing SQL Server without static IP Pin
Steve S7-Dec-04 1:33
Steve S7-Dec-04 1:33 
GeneralRe: Accessing SQL Server without static IP Pin
Mekong River9-Dec-04 4:27
Mekong River9-Dec-04 4:27 
GeneralAccessing SQL Server without static IP Pin
johnie836-Dec-04 18:44
johnie836-Dec-04 18:44 
Generalprogress Pin
Yulianto.6-Dec-04 15:45
Yulianto.6-Dec-04 15:45 
GeneralRe: progress Pin
Dave Kreskowiak10-Dec-04 9:50
mveDave Kreskowiak10-Dec-04 9:50 
GeneralInvoke oracle job remotley Pin
RobNicolson6-Dec-04 4:44
RobNicolson6-Dec-04 4:44 
QuestionBLOBs: How to insert/store and get/retrieve an object? Pin
Rafferty Uy5-Dec-04 13:58
Rafferty Uy5-Dec-04 13:58 
AnswerRe: BLOBs: How to insert/store an object? Pin
Steve S6-Dec-04 1:32
Steve S6-Dec-04 1:32 
GeneralRe: BLOBs: How to insert/store an object? Pin
Rafferty Uy6-Dec-04 13:18
Rafferty Uy6-Dec-04 13:18 

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.