Thread: How to insert Images(bnp,png,etc) into Postgresql and how to retrive the inserted Imaged using C#.net

Dear All,<br /><br />  I want   to insert Images(bnp,png,etc) into Postgresql and how to retrieve the inserted Imaged
usingC#.net.I do not know where to start? Any one can help me.<br /><br /> I am waiting for your great response.<br
/><br/>Advanced Thanks,<br />Venkat.<br /><br /><br clear="all" /><br /> 
venkat написа:
> Dear All,
> 
>   I want   to insert Images(bnp,png,etc) into Postgresql and how to retrieve
> the inserted Imaged using C#.net.I do not know where to start? Any one can
> help me.
[...]

Start here  -
http://npgsql.projects.postgresql.org/docs/manual/UserManual.html and
look for "Working with binary data and bytea datatype".


-- 
Milen A. Radev



HI Milen,<br /><br />  Thanks for your great response,I do not find anything like insert images.. I have seen the whole
tutorial..Pleasecan you give me some example to insert images into postgresql.<br /><br />I am waiting for your great
response.<br/><br />Thanks,<br />Venkat.<br /><br /><div class="gmail_quote">On Thu, Dec 18, 2008 at 8:02 PM, Milen A.
Radev<span dir="ltr"><<a href="mailto:milen@radev.net">milen@radev.net</a>></span> wrote:<br /><blockquote
class="gmail_quote"style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
venkatнаписа:<br /><div class="Ih2E3d">> Dear All,<br /> ><br /> >   I want   to insert Images(bnp,png,etc)
intoPostgresql and how to retrieve<br /> > the inserted Imaged using C#.net.I do not know where to start? Any one
can<br/> > help me.<br /></div>[...]<br /><br /> Start here  -<br /><a
href="http://npgsql.projects.postgresql.org/docs/manual/UserManual.html"
target="_blank">http://npgsql.projects.postgresql.org/docs/manual/UserManual.html</a>and<br /> look for "Working with
binarydata and bytea datatype".<br /><br /><br /> --<br /> Milen A. Radev<br /><font color="#888888"><br /><br /> --<br
/>Sent via pgsql-sql mailing list (<a href="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a>)<br /> To
makechanges to your subscription:<br /><a href="http://www.postgresql.org/mailpref/pgsql-sql"
target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a><br/></font></blockquote></div><br /><br clear="all"
/><br/>-- <br />Thanks And Regards,<br />VENKATRAO TAMMINENI<br /> 
venkat wrote:
> HI Milen,
>
>   Thanks for your great response,I do not find anything like insert 
> images.. I have seen the whole tutorial..Please can you give me some 
> example to insert images into postgresql.
>
> I am waiting for your great response.

PostgreSQL has a general binary datatype called "bytea". There is no 
specific data type of "image", "jpg", "png", etc.

It is up to you to read the binary data, be it images, audio, or 
whatever and store them in your "bytea" column. As previously suggested, 
scroll down to the part titled "Working with binary data and bytea 
datatype" and try the example code there. Just feed it your images as 
input and all should be good.

Cheers,
Steve