• 大小: 70KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-16
  • 语言: C#
  • 标签: C#  Orale  

资源简介

用C#和Oracle实现的小系统,包括基本的添加,删除,修改,查询功能 用C#和Oracle实现的小系统,包括基本的添加,删除,修改,查询功能 用C#和Oracle实现的小系统,包括基本的添加,删除,修改,查询功能

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.OracleClient;

namespace Oracle
{
    public partial class addgoods : Form
    {
        public addgoods()
        {
            InitializeComponent();
        }

        private void addgoods_Load(object sender EventArgs e)
        {
            OracleConnection con = new OracleConnection(“Data Source=orcl;User ID=sa;password=123;“);
            OracleDataAdapter da = new OracleDataAdapter();
            OracleCommand cmd = new OracleCommand();
            cmd.Connection = con;
            cmd.CommandText = “FROMNAME“;
            OracleParameter param_out = cmd.Parameters.Add(“P_CURSOR“ OracleType.Cursor);
            param_out.Direction = ParameterDirection.Output;
            cmd.CommandType = CommandType.StoredProcedure;
            da.SelectCommand = cmd;
            DataTable dt = new DataTable();
            da.Fill(dt);
            comboBox1.DataSource = dt;
            comboBox1.DisplayMember = “FROMNAME“;
            comboBox1.ValueMember = “FROMID“;
        }

        //添加商品
        private void button1_Click(object sender EventArgs e)
        {
            if (textBox1.Text.Trim() != ““ && textBox2.Text.Trim() != ““)
            {

                OracleConnection con = new OracleConnection(“Data Source=orcl;User ID=sa;password=123;“);
                OracleCommand cmd = new OracleCommand();
                con.Open();
                cmd.Connection = con;
                cmd.CommandText = “ADDGOODS“;
                OracleParameter[] parameters ={
                                 new OracleParameter(“goodsname“OracleType.VarChar200)
                                new OracleParameter(“fromid“OracleType.Number)
                                 new OracleParameter(“num“OracleType.Float)
                                                };
                parameters[0].Value = textBox1.Text.Trim();
                parameters[1].Value = comboBox1.SelectedValue.ToString();
                parameters[2].Value = textBox2.Text.Trim(); ;
                parameters[0].Direction = ParameterDirection.Input;
                parameters[1].Direction = ParameterDirection.Input;
                parameters[2].Direction = ParameterDirection.Input;
                foreach (OracleParameter parameter in parameters)
                {
                    cmd.Parameters.Add(parameter);
                }
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.ExecuteNonQuery();
                con.Close();
                MessageBox.Show(“添加成功“);
                this.Close();
            }
        }

        private void button2_Click(object sender EventArgs e)
        {
            this.Close();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        911  2010-03-04 15:19  C#连接Oracle实例\DB.txt

     文件       3009  2010-03-02 02:31  C#连接Oracle实例\Oracle\addgoods.cs

     文件       5882  2010-03-01 11:08  C#连接Oracle实例\Oracle\addgoods.Designer.cs

     文件       5814  2010-03-01 11:08  C#连接Oracle实例\Oracle\addgoods.resx

     文件      20992  2010-03-02 01:00  C#连接Oracle实例\Oracle\bin\Debug\Oracle.exe

     文件      48640  2010-03-02 01:00  C#连接Oracle实例\Oracle\bin\Debug\Oracle.pdb

     文件      14328  2010-03-02 12:48  C#连接Oracle实例\Oracle\bin\Debug\Oracle.vshost.exe

     文件        490  2007-07-21 01:33  C#连接Oracle实例\Oracle\bin\Debug\Oracle.vshost.exe.manifest

     文件       4945  2010-03-02 02:31  C#连接Oracle实例\Oracle\Form1.cs

     文件      10134  2010-03-01 21:30  C#连接Oracle实例\Oracle\Form1.Designer.cs

     文件       8090  2010-03-01 21:30  C#连接Oracle实例\Oracle\Form1.resx

     文件        180  2010-03-02 00:04  C#连接Oracle实例\Oracle\obj\Debug\Oracle.addgoods.resources

     文件        552  2010-03-02 12:48  C#连接Oracle实例\Oracle\obj\Debug\Oracle.csproj.FileListAbsolute.txt

     文件       1023  2010-03-02 00:47  C#连接Oracle实例\Oracle\obj\Debug\Oracle.csproj.GenerateResource.Cache

     文件      20992  2010-03-02 01:00  C#连接Oracle实例\Oracle\obj\Debug\Oracle.exe

     文件        180  2010-03-02 00:04  C#连接Oracle实例\Oracle\obj\Debug\Oracle.Form1.resources

     文件      48640  2010-03-02 01:00  C#连接Oracle实例\Oracle\obj\Debug\Oracle.pdb

     文件        180  2010-03-02 00:04  C#连接Oracle实例\Oracle\obj\Debug\Oracle.Properties.Resources.resources

     文件        180  2010-03-02 00:04  C#连接Oracle实例\Oracle\obj\Debug\Oracle.xg.resources

     文件        180  2010-03-02 00:47  C#连接Oracle实例\Oracle\obj\Debug\Oracle.xggoods.resources

     文件       4699  2010-03-02 00:04  C#连接Oracle实例\Oracle\Oracle.csproj

     文件        901  2010-03-02 02:31  C#连接Oracle实例\Oracle\Oracle.sln

    ..A..H.     16896  2010-03-02 13:06  C#连接Oracle实例\Oracle\Oracle.suo

     文件        487  2010-02-28 20:05  C#连接Oracle实例\Oracle\Program.cs

     文件       1392  2010-02-28 20:05  C#连接Oracle实例\Oracle\Properties\AssemblyInfo.cs

     文件       2862  2010-02-28 20:05  C#连接Oracle实例\Oracle\Properties\Resources.Designer.cs

     文件       5612  2010-02-28 20:05  C#连接Oracle实例\Oracle\Properties\Resources.resx

     文件       1091  2010-02-28 20:05  C#连接Oracle实例\Oracle\Properties\Settings.Designer.cs

     文件        249  2010-02-28 20:05  C#连接Oracle实例\Oracle\Properties\Settings.settings

     文件       3011  2010-03-01 23:15  C#连接Oracle实例\Oracle\xg.cs

............此处省略20个文件信息

评论

共有 条评论