A text box is provided to allow users to enter a large number of values and save them to the Oracle database.
To save a large amount of data, set the field type to blob.
Similar help on the network is too complicated. It is found that it is relatively simple to only perform operations in files.
Ideas:
1. Convert text to binary
Byte [] ddd;
Ddd = System. Text. Encoding. Unicode. GetBytes (this. textBox1.Text );
2. Then store the binary into the database, and find that this access method to the database is feasible.
Cmd. Parameters. Add...
Cmd. ExecuteNonQuery ();
The table structure is as follows:
Create table XLUTEST
(
Hhhh blob,
GGGG VARCHAR2 (10)
)
Tablespace SYSTEM
Pctfree 10
Pctused 40
Initrans 1
Maxtrans 255
Storage
(
Initial 64 K
Minextents 1
Maxextents unlimited
)
C # All WINFORM codes are as follows:
Using System;
Using System. Drawing;
Using System. Collections;
Using System. ComponentModel;
Using System. Windows. Forms;
Using System. Data;
Using System. Data. OleDb;
Using System. IO;
Namespace blob
{
/// <Summary>
/// Summary of Form1.
/// </Summary>
Public class Form1: System. Windows. Forms. Form
{
Private System. Windows. Forms. TextBox textBox1;
Private System. Windows. Forms. Button button1;
Private System. Windows. Forms. Button button2;
Private System. Windows. Forms. Button button3;
/// <Summary>
/// Required designer variables.
/// </Summary>
Private System. ComponentModel. Container components = null;
Public Form1 ()
{
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service