If I have a table with an image column, how can I add an image file to the
image field? Using ADO.Net I can use the command object to add text data
like this:
cmd.CommandText = "Insert Into tlb1(fld1) Values('test1')"
cmd.ExecuteNonQuery()
But what if I want to add the file at C:\dir1\pic1.jpg?
cmd.CommandText = ?
Do I need to use the ADODB Stream Object for this? While I am at it, is
there a difference between storing an image file in an image column or a
binary column?
Thanks,
RichJust have a look here, there is a code snipplet presented within the
article:
http://www.codeproject.com/aspnet/PicManager.asp
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Rich" <Rich@.discussions.microsoft.com> schrieb im Newsbeitrag
news:B848F047-4D0A-4EAE-B609-3DC58482FFA0@.microsoft.com...
> If I have a table with an image column, how can I add an image file to the
> image field? Using ADO.Net I can use the command object to add text data
> like this:
> cmd.CommandText = "Insert Into tlb1(fld1) Values('test1')"
> cmd.ExecuteNonQuery()
> But what if I want to add the file at C:\dir1\pic1.jpg?
> cmd.CommandText = ?
> Do I need to use the ADODB Stream Object for this? While I am at it, is
> there a difference between storing an image file in an image column or a
> binary column?
> Thanks,
> Rich
>|||Thanks very much for your reply. I retrieved the code you pointed me to.
But one problem I seem to always have is that when I try to run an aspx app
that I copied from somewhere else I keep getting the following error message
:
"Error while trying to run project: Unable to start debugging on the web
server. The project is not configured to be debugged."
My workaround has been to create a whole new project and copy the parts from
the original project. I have explored the Assembly file, the WebConfig file
to see if there is anything to configure there. But I have not had any luck
.
Do you know how I could configure this application so that I don't have to
create a whole new one?
Thanks again,
Rich
"Jens Sü?meyer" wrote:
> Just have a look here, there is a code snipplet presented within the
> article:
> http://www.codeproject.com/aspnet/PicManager.asp
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Rich" <Rich@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:B848F047-4D0A-4EAE-B609-3DC58482FFA0@.microsoft.com...
>
>|||Well, I went ahead and created a new project. When I ran it - it worked
perfectly! Thanks very much for your help.
Rich
"Rich" wrote:
> Thanks very much for your reply. I retrieved the code you pointed me to.
> But one problem I seem to always have is that when I try to run an aspx ap
p
> that I copied from somewhere else I keep getting the following error messa
ge:
> "Error while trying to run project: Unable to start debugging on the web
> server. The project is not configured to be debugged."
> My workaround has been to create a whole new project and copy the parts fr
om
> the original project. I have explored the Assembly file, the WebConfig fi
le
> to see if there is anything to configure there. But I have not had any lu
ck.
> Do you know how I could configure this application so that I don't have t
o
> create a whole new one?
> Thanks again,
> Rich
> "Jens Sü?meyer" wrote:
>|||One more question if I may. This routine is using a Web button which
contains the PostedFile method.
Upload.PostedFile.InputStream.Read (pic, 0, len);
So, even though this works, I can only do it from an aspx page. Can
something like this be done using ADO/ADO.Net?
Anyway, thanks again for your help on this.
Rich
"Rich" wrote:
> Well, I went ahead and created a new project. When I ran it - it worked
> perfectly! Thanks very much for your help.
> Rich
> "Rich" wrote:
>|||You have to go in the properties of the virtual Directory and create an
Applicationame for the Virtual Directory, then it is ackknowledge from IIS
as an asp.NET project.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Rich" <Rich@.discussions.microsoft.com> schrieb im Newsbeitrag
news:7CD9B4A2-0EB2-49F2-8157-F6C22C81E247@.microsoft.com...
> Thanks very much for your reply. I retrieved the code you pointed me to.
> But one problem I seem to always have is that when I try to run an aspx
> app
> that I copied from somewhere else I keep getting the following error
> message:
> "Error while trying to run project: Unable to start debugging on the web
> server. The project is not configured to be debugged."
> My workaround has been to create a whole new project and copy the parts
> from
> the original project. I have explored the Assembly file, the WebConfig
> file
> to see if there is anything to configure there. But I have not had any
> luck.
> Do you know how I could configure this application so that I don't have to
> create a whole new one?
> Thanks again,
> Rich
> "Jens Smeyer" wrote:
>|||http://support.microsoft.com/kb/309158/en-us
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Rich" <Rich@.discussions.microsoft.com> schrieb im Newsbeitrag
news:87DAE68E-8E09-4FF9-A7A2-F317A7B2618E@.microsoft.com...
> One more question if I may. This routine is using a Web button which
> contains the PostedFile method.
> Upload.PostedFile.InputStream.Read (pic, 0, len);
> So, even though this works, I can only do it from an aspx page. Can
> something like this be done using ADO/ADO.Net?
> Anyway, thanks again for your help on this.
> Rich
> "Rich" wrote:
>|||Thank you again for your help. And I appologize for my ignorance. Anyway,
I
went to the properties of my virtual directory. There is already an
application name there - the name of the virtual directory. I am not clear
on what name I should put in there. Is it the name of my project? So
everytime I copy a project from somehwere I put the name of that project in
the Application name box in the properties of the Virtual directory?
Thanks also for the article on using ADO.Net for writing blobs to Sql
Server.
Rich
"Jens Sü?meyer" wrote:
> You have to go in the properties of the virtual Directory and create an
> Applicationame for the Virtual Directory, then it is ackknowledge from IIS
> as an asp.NET project.
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Rich" <Rich@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:7CD9B4A2-0EB2-49F2-8157-F6C22C81E247@.microsoft.com...
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment