Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Image not been displayed from SQL Pin
Colin Angus Mackay1-Feb-09 12:43
Colin Angus Mackay1-Feb-09 12:43 
GeneralRe: Image not been displayed from SQL Pin
vaghelabhavesh1-Feb-09 13:02
vaghelabhavesh1-Feb-09 13:02 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay1-Feb-09 13:04
Colin Angus Mackay1-Feb-09 13:04 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:19
Anita_Kamat_inds1-Feb-09 16:19 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay2-Feb-09 8:43
Colin Angus Mackay2-Feb-09 8:43 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds2-Feb-09 9:02
Anita_Kamat_inds2-Feb-09 9:02 
GeneralRe: Image not been displayed from SQL Pin
Colin Angus Mackay2-Feb-09 9:53
Colin Angus Mackay2-Feb-09 9:53 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds2-Feb-09 10:01
Anita_Kamat_inds2-Feb-09 10:01 
this is the code I am using to insert the image into the db. I think this line of code has en error:

nBytesRead = theStream.Read(Buffer, 0, BUFFER_SIZE);

the BUFFER_SIZE should be the size of the image,not a const. my guess.


const int BUFFER_SIZE = 255;
int nBytesRead = 0;
Byte[] Buffer = new Byte[BUFFER_SIZE];
StringBuilder strUploadedContent = new StringBuilder("");

Stream theStream = uplTheFile.PostedFile.InputStream;
nBytesRead = theStream.Read(Buffer, 0, BUFFER_SIZE);

while (0 != nBytesRead)
{
strUploadedContent.Append(Encoding.ASCII.GetString(Buffer, 0, nBytesRead));
nBytesRead = theStream.Read(Buffer, 0, BUFFER_SIZE);
}



HttpPostedFile UploadPic = uplTheFile.PostedFile;
int UploadPicLength = UploadPic.ContentLength;
byte[] PicArray = new byte[UploadPicLength];
UploadPic.InputStream.Read(PicArray, 0, UploadPicLength);

OleDbConnection conn = new OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings["XXXXXX"].ConnectionString);

OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;

string strSQL = "Update tbl set FileData= '" + UploadPic + "' WHERE (ID = 'xcv') ";
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:06
Anita_Kamat_inds1-Feb-09 16:06 
GeneralRe: Image not been displayed from SQL Pin
Anita_Kamat_inds1-Feb-09 16:08
Anita_Kamat_inds1-Feb-09 16:08 
QuestionGridview binding to both base n derived classes Pin
dotnet.coder1-Feb-09 2:59
dotnet.coder1-Feb-09 2:59 
AnswerRe: Gridview binding to both base n derived classes Pin
Manas Bhardwaj1-Feb-09 4:01
professionalManas Bhardwaj1-Feb-09 4:01 
QuestionLabel and Absolute Positioning Pin
swjam1-Feb-09 1:15
swjam1-Feb-09 1:15 
QuestionAutocomplete AJAX Pin
CrimeanTurtle20081-Feb-09 0:23
CrimeanTurtle20081-Feb-09 0:23 
Questionjavascript Pin
kushalrshah1-Feb-09 0:06
kushalrshah1-Feb-09 0:06 
AnswerRe: javascript Pin
mr_muskurahat1-Feb-09 3:17
mr_muskurahat1-Feb-09 3:17 
AnswerRe: javascript Pin
vaghelabhavesh1-Feb-09 12:56
vaghelabhavesh1-Feb-09 12:56 
GeneralRe: javascript Pin
kushalrshah1-Feb-09 17:57
kushalrshah1-Feb-09 17:57 
GeneralRe: javascript Pin
kushalrshah1-Feb-09 17:58
kushalrshah1-Feb-09 17:58 
GeneralRe: javascript Pin
vaghelabhavesh2-Feb-09 3:11
vaghelabhavesh2-Feb-09 3:11 
QuestionVBRUN : 80040154 Pin
coolestCoder31-Jan-09 21:07
coolestCoder31-Jan-09 21:07 
QuestionData Provider for Oracle/ODBC Pin
Girish48131-Jan-09 19:51
Girish48131-Jan-09 19:51 
AnswerRe: Data Provider for Oracle/ODBC Pin
Christian Graus31-Jan-09 22:20
protectorChristian Graus31-Jan-09 22:20 
QuestionAutomatic Order Print Pin
SarfarajAhmed31-Jan-09 7:03
SarfarajAhmed31-Jan-09 7:03 
AnswerRe: Automatic Order Print Pin
Christian Graus31-Jan-09 8:44
protectorChristian Graus31-Jan-09 8:44 

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.