473,800 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1849
Frinavale
9,735 Recognized Expert Moderator Expert
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
2077
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) I have a simple php script, getFile.php to receive the file. The script look like this: <?php $uploadDir = '/var/www/Incoming/'; $uploadFile = $uploadDir . $_FILES; print "<pre>";
4
2303
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) I have a simple php script, getFile.php to receive the file. The script look like this: <?php $uploadDir = '/var/www/Incoming/'; $uploadFile = $uploadDir . $_FILES;
1
3885
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 building report for the web, so any suggestions,Links,sample code, etc.. will be great. Any suggestions out there?
3
462
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: <%@ Page Language="vb" AutoEventWireup="true" Codebehind="RegisterForm.aspx.vb" Inherits="WebApplication1.RegisterForm"%> <%@ import Namespace="System.data.oledb" %>
8
1540
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 to add the order into the database and assign it a unique ID ("EITReqCode"), and made it e-mail the it purchaser via SMTP automatically with a link to the "Authorisation" page where they
2
995
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 file to the user. How do I do that? Any examples available?
1
956
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 with the sql statements to retrieve data from my data base. The problem is I dont know the right way to make loops to get information for each row programatically istead of using gridview sort of components. Any help would be appreciated. Thanks...
0
1495
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 this problem b4 or have code for this case ? thank you
1
1136
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 database- Sql Server 2005. Now im having trouble to even understand how these applications can share the same database. Can someone tell me how this is done. Code Snippets would help a lot. Kind Regards
2
2535
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 done currently is uploading a file to database but totally no idea about how to "download" from database the following is my codes to upload file to database: If Not (myFile.PostedFile Is Nothing) Then OpenConn()
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.