Weird problem inserting image in DB...

  • Thread starter Pablo Alvarez Doval
  • Start date
P

Pablo Alvarez Doval

Hi all,

I'm experiencing quite a weird problem inserting an image in a database.
I've designed a small form with some fields and a picturebox. I can fill all
of them and clcik the 'create item' button, and the task is performed
wonderfully, but as soon as I try to insert the data with the image set, it
simply won't insert it.

Debuggin the application I see that the data row is allways OK (even the
image) just prior to the TableAdapter.Update(), but the update method
returns 0 and HasErros equals false.

Up until this point, I would call the problem to be a bitch, but not wird
xD The 'weirdness' comes here:

I've attached a SQL Profiler to the user instance and found that the
following entries happen JUST when I try to insert the item with the image
field binded (and not when there is no image field set)...

<profiler log>
ErrorLog 2007-03-01 21:17:09.02 spid52 Error: 17207, Severity: 16,
State: 1.
2007-03-01 21:17:09.02 spid52 FCB::RemoveAlternateStreams: Operating
system error (null) occurred while creating or opening file 'C:\Documents
and Settings\Pablo Alvarez\Mis documentos\Visual Studio 2005\Projects\Copia
de Aselbi\Aselbi\bin\Debug\GRADB.mdf'. Diagnose and correct the operating
system error, and retry the operation.

ErrorLog 2007-03-01 21:17:09.07 spid52 Starting up database
'C:\DOCUMENTS AND SETTINGS\PABLO ALVAREZ\MIS DOCUMENTOS\VISUAL STUDIO
2005\PROJECTS\COPIA DE ASELBI\ASELBI\BIN\DEBUG\GRADB.MDF'.
</profiler log>

This error repeats three times. I've checked with sysinternal's filemon and
I get an error 0xC0000042 on sqlservr.exe trying to acces 'C:\DOCUMENTS AND
SETTINGS\PABLO ALVAREZ\MIS DOCUMENTOS\VISUAL STUDIO 2005\PROJECTS\COPIA DE
ASELBI\ASELBI\BIN\DEBUG\GRADB.MDF' two times.

Why is this happening just when the image field on the row is set? any
clues?! I'm really frustrated :(

Environment Description:

- Working in a Virtual PC (host: Vista, VPC: WinXP SP2)
- The application I'm developing is an VSTO addin for Outlook 2003 (VSTO
2005SE)
- SQL Server 2005 express
- The VPC does not have antivirus nor anything that could have installed
a filter driver that holds the file

Thanks a lot in advance!
Pablo
 
M

Miha Markic [MVP C#]

Perhaps there are NTFS security problems for sql server to open mdf in
question?
 
P

Pablo Alvarez Doval

Thanks for the response, but I've already checked that.. and by the way, in
that case, I doubt the update with all fields except the images would work
:(
I am really in a urge, and I've been with this problem since yesterday
morning, I cannot find a reason.. quite frustrating, but lovely challenging
XD

Cheers!
Pablo

Miha Markic said:
Perhaps there are NTFS security problems for sql server to open mdf in
question?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Pablo Alvarez Doval said:
Hi all,

I'm experiencing quite a weird problem inserting an image in a
database.
I've designed a small form with some fields and a picturebox. I can fill
all
of them and clcik the 'create item' button, and the task is performed
wonderfully, but as soon as I try to insert the data with the image set,
it
simply won't insert it.

Debuggin the application I see that the data row is allways OK (even
the
image) just prior to the TableAdapter.Update(), but the update method
returns 0 and HasErros equals false.

Up until this point, I would call the problem to be a bitch, but not
wird
xD The 'weirdness' comes here:

I've attached a SQL Profiler to the user instance and found that the
following entries happen JUST when I try to insert the item with the
image
field binded (and not when there is no image field set)...

<profiler log>
ErrorLog 2007-03-01 21:17:09.02 spid52 Error: 17207, Severity: 16,
State: 1.
2007-03-01 21:17:09.02 spid52 FCB::RemoveAlternateStreams: Operating
system error (null) occurred while creating or opening file 'C:\Documents
and Settings\Pablo Alvarez\Mis documentos\Visual Studio
2005\Projects\Copia
de Aselbi\Aselbi\bin\Debug\GRADB.mdf'. Diagnose and correct the operating
system error, and retry the operation.

ErrorLog 2007-03-01 21:17:09.07 spid52 Starting up database
'C:\DOCUMENTS AND SETTINGS\PABLO ALVAREZ\MIS DOCUMENTOS\VISUAL STUDIO
2005\PROJECTS\COPIA DE ASELBI\ASELBI\BIN\DEBUG\GRADB.MDF'.
</profiler log>

This error repeats three times. I've checked with sysinternal's filemon
and
I get an error 0xC0000042 on sqlservr.exe trying to acces 'C:\DOCUMENTS
AND
SETTINGS\PABLO ALVAREZ\MIS DOCUMENTOS\VISUAL STUDIO 2005\PROJECTS\COPIA
DE
ASELBI\ASELBI\BIN\DEBUG\GRADB.MDF' two times.

Why is this happening just when the image field on the row is set? any
clues?! I'm really frustrated :(

Environment Description:

- Working in a Virtual PC (host: Vista, VPC: WinXP SP2)
- The application I'm developing is an VSTO addin for Outlook 2003
(VSTO
2005SE)
- SQL Server 2005 express
- The VPC does not have antivirus nor anything that could have
installed
a filter driver that holds the file

Thanks a lot in advance!
Pablo
 
M

Miha Markic [MVP C#]

Try inserting a small byte array instead of picture. Just for testing
purposes.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Pablo Alvarez Doval said:
Thanks for the response, but I've already checked that.. and by the way,
in that case, I doubt the update with all fields except the images would
work :(
I am really in a urge, and I've been with this problem since yesterday
morning, I cannot find a reason.. quite frustrating, but lovely
challenging XD

Cheers!
Pablo

Miha Markic said:
Perhaps there are NTFS security problems for sql server to open mdf in
question?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Pablo Alvarez Doval said:
Hi all,

I'm experiencing quite a weird problem inserting an image in a
database.
I've designed a small form with some fields and a picturebox. I can fill
all
of them and clcik the 'create item' button, and the task is performed
wonderfully, but as soon as I try to insert the data with the image set,
it
simply won't insert it.

Debuggin the application I see that the data row is allways OK (even
the
image) just prior to the TableAdapter.Update(), but the update method
returns 0 and HasErros equals false.

Up until this point, I would call the problem to be a bitch, but not
wird
xD The 'weirdness' comes here:

I've attached a SQL Profiler to the user instance and found that the
following entries happen JUST when I try to insert the item with the
image
field binded (and not when there is no image field set)...

<profiler log>
ErrorLog 2007-03-01 21:17:09.02 spid52 Error: 17207, Severity: 16,
State: 1.
2007-03-01 21:17:09.02 spid52 FCB::RemoveAlternateStreams:
Operating
system error (null) occurred while creating or opening file
'C:\Documents
and Settings\Pablo Alvarez\Mis documentos\Visual Studio
2005\Projects\Copia
de Aselbi\Aselbi\bin\Debug\GRADB.mdf'. Diagnose and correct the
operating
system error, and retry the operation.

ErrorLog 2007-03-01 21:17:09.07 spid52 Starting up database
'C:\DOCUMENTS AND SETTINGS\PABLO ALVAREZ\MIS DOCUMENTOS\VISUAL STUDIO
2005\PROJECTS\COPIA DE ASELBI\ASELBI\BIN\DEBUG\GRADB.MDF'.
</profiler log>

This error repeats three times. I've checked with sysinternal's filemon
and
I get an error 0xC0000042 on sqlservr.exe trying to acces 'C:\DOCUMENTS
AND
SETTINGS\PABLO ALVAREZ\MIS DOCUMENTOS\VISUAL STUDIO 2005\PROJECTS\COPIA
DE
ASELBI\ASELBI\BIN\DEBUG\GRADB.MDF' two times.

Why is this happening just when the image field on the row is set? any
clues?! I'm really frustrated :(

Environment Description:

- Working in a Virtual PC (host: Vista, VPC: WinXP SP2)
- The application I'm developing is an VSTO addin for Outlook 2003
(VSTO
2005SE)
- SQL Server 2005 express
- The VPC does not have antivirus nor anything that could have
installed
a filter driver that holds the file

Thanks a lot in advance!
Pablo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top