473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

storing and retrieving image in oralce database using TOAD in asp.net(vb)

i am using TOAD,i need help in storing and retrieving image from oracle9i database.
here is my code:
Expand|Select|Wrap|Line Numbers
  1. Imports System.Data.OracleClient
  2. Imports System.Data
  3. Imports System .Drawing 
  4. Imports System.IO
  5. Imports System.Web
  6. Imports System.Configuration
  7. Imports System.Drawing.Imaging
  8.  
  9.  
  10. Partial Class PERSONAL_INFO
  11.     Inherits System.Web.UI.Page
  12.     Dim cn As New OracleConnection
  13.  
  14.     Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
  15.  
  16.     Protected Sub btnsave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsave.Click
  17.         Dim funct As New Dboperation
  18.         funct.Connect()
  19.         Dim cmd As New OracleCommand
  20.         cmd.CommandType = CommandType.StoredProcedure
  21.  
  22.         cmd.Connection = funct.cn
  23.         cmd.CommandType = Data.CommandType.Text
  24.         Dim extension As String = System.IO.Path.GetExtension(fupPhoto.PostedFile.FileName).ToLower()
  25.  
  26.         cmd.CommandText = "Insert into tblphotos values ('" & txtemplid.Text & "',@photos ,'" & extension & "')"
  27.  
  28.         Dim imageBytes(fupPhoto.PostedFile.InputStream.Length) As Byte
  29.         fupPhoto.PostedFile.InputStream.Read(imageBytes, 0, imageBytes.Length)
  30.  
  31.         Dim arg As OracleParameter
  32.  
  33.         'arg = New OracleParameter("@photos", Data.SqlDbType.Image, imageBytes.Length)
  34.  
  35.         arg = New OracleParameter("@photos", OracleType.Clob)
  36.  
  37.         arg.Value = imageBytes
  38.         cmd.Parameters.Add(arg)
  39.         cmd.ExecuteNonQuery()
  40.         funct.Msg("Picture added", Page)
  41.         cn.Close()
  42.     End Sub
  43. End Class
  44.  
Nov 25 '10 #1
1 1819
Frinavale
9,735 Expert Mod 8TB
I've never heard of TOAD before, but it would help if you mentioned what problems you are currently encountering. What error messages are you seeing?
Nov 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: brianinbox | last post by:
Hi, I've been trying to upload file using webclient.uploadfile method from my IIS webserver to an Apache webserver without any success. On the Apache server (server that receives the incoming file)...
4
by: brianinbox | last post by:
Hi, I've been trying to upload file using webclient.uploadfile method from my IIS webserver to an Apache webserver without any success. On the Apache server (server that receives the incoming...
1
by: jayuya | last post by:
I have to provide the users with data in the form of Web Reports. Crystal Licensing...Very expensive for us. PDF? Can I take data from ADO.net into and create PDF? This will be my first time...
3
by: Kevin | last post by:
Hello experts, I'm a newbee to ASP.NET. And I have been struggling solving this problem. But I can't do it. Can you please help me get over this wall? Below is the code and error message: <%@...
8
by: Jimbo | last post by:
Hello I am currently designing an internal ordering system for IT equipment. I am designing it in ASP.NET (vb) using Visual Studio 2003 and using Microsoft SQL Server I have got the system...
2
by: No_Spam | last post by:
I have an Excel sheet that I want to be able to make changes to it using ASP/VB.NET (like updating cells values and maybe formulas). Once it's done; I want to save it and then launch the changed...
1
by: thiago777 | last post by:
Hello, Im used to php programming and not so familiar with database connections throught VB. I managed to connect to my mssql server using Visual Studio 2005's wizards and even created a method...
0
by: levis123 | last post by:
hi, anybody know how to import excel data into sql server using asp.net (vb.net). i've read some articles in the internet, however, try to implement it seems...still have problems...any1 who solved...
1
by: Luzuko | last post by:
HI, Im doing a project and the basic requirements of the project is that my Front-end application (VB 2005) and Web application(VB Scripting and ASP) should write and retrieve from the SAME...
2
by: simonyong | last post by:
Hello, anyone I had search for few days with how to save file when user choose a file name from listbox and i will search the file from database and user can save it into their desktop what I had...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.