0

I am storing an image using l_oid (postgresql). Now i want know convert l_oid to bytea and bytea to image in front end(vb.net)

[note: i dont want to use lo_import and lo_export because i need this in client server application]

can anybody having solution to solve this?

2
  • 1
    Usually when working with large objects you use native client driver extensions to call lo_read. If you're using nPgSQL you should read npgsql.projects.pgfoundry.org/docs/manual/UserManual.html and look at the "large objects" section. It's C# code but the example should give you an idea of how to do it in VB.net. The second example is about exactly what you want to do. If you're not using npgsql - say you're connected via ODBC or ADO - then it's going to be harder. Commented Mar 6, 2013 at 23:50
  • @CraigRinger I have tested your solution, its working fine, can you make your comment as an answer? so that i could accept it. Commented Mar 7, 2013 at 5:34

1 Answer 1

1

Use the SQL function loread( integer integer ) to read BLOB's as bytea's. You can retrieve or insert byteas using Npgsql or write a UDF to convert the bytea to Base64 format and return those as text

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.