Home All Groups Group Topic Archive Search About

Weird problem inserting image in DB...

Author
2 Mar 2007 2:26 PM
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

Author
2 Mar 2007 5:16 PM
Miha Markic [MVP C#]
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/

Show quote
"Pablo Alvarez Doval" <pab***@plainconcepts.com> wrote in message
news:69E87E39-8ECB-4CD1-8368-D3F0C3AF0D03@microsoft.com...
> 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
>
>
Author
2 Mar 2007 5:21 PM
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

Show quote
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:5F09A78A-DAA9-47D2-AF27-1F35010FF6F3@microsoft.com...
> 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" <pab***@plainconcepts.com> wrote in message
> news:69E87E39-8ECB-4CD1-8368-D3F0C3AF0D03@microsoft.com...
>> 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
>>
>>
>
Author
2 Mar 2007 7:46 PM
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/

Show quote
"Pablo Alvarez Doval" <pab***@plainconcepts.com> wrote in message
news:48F631B3-C71C-4D77-96D6-5C0BD160467E@microsoft.com...
> 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 [MVP C#]" <miha at rthand com> wrote in message
> news:5F09A78A-DAA9-47D2-AF27-1F35010FF6F3@microsoft.com...
>> 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" <pab***@plainconcepts.com> wrote in message
>> news:69E87E39-8ECB-4CD1-8368-D3F0C3AF0D03@microsoft.com...
>>> 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
>>>
>>>
>>
>

AddThis Social Bookmark Button