急急如意令!!!!!!!!!
我是新人,求大神调教!!!!!!!!!!
我用的是vs2010版本,oracle是10g的,做一个windows窗体,要求能对oracle数据库emp表进行增删改查的功能,求代码或者是.exe文件都行,可以的话发到[email protected]邮箱中,谢谢!!!!!oracle数据库vs2010

解决方案 »

  1.   

    C#操作Oracle数据库  
      

  2.   

    嗯 知道了 我以前是学数学的 是最近才学。net的 很多东西不懂 嘿嘿
      

  3.   

    谁知道调试的时候出现这个错误怎么弄    keyword not supported: inital catalog
      

  4.   

      keyword not supported: inital catalog
    关键字某某,说明sql字段有关建字或啥的。
      

  5.   

    哪位大神看出这段代码的错误了,目的是向oracle里添加数据,填不进去啊
    public partial class Form2 : Form
        {
            public Form2()
            {
                InitializeComponent();
            }        private void Form2_Load(object sender, EventArgs e)
            {
                comboBox1.Items.Add("男");
                comboBox1.Items.Add("女");
                comboBox2.Items.Add("1班");
                comboBox2.Items.Add("2班");
                comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
                comboBox2.DropDownStyle = ComboBoxStyle.DropDownList;
                get_bh();
            }        private void get_bh()
            {
                OracleConnection conn = new OracleConnection();
                string str = "Data Source=oracleqq;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True";
                conn.ConnectionString = str;
                conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.CommandText = "select * from student";
                cmd.Connection = conn;
                OracleDataAdapter sda = new OracleDataAdapter(cmd);
                DataSet ds = new DataSet();
                sda.Fill(ds);
                int t = ds.Tables[0].Rows.Count;
                int bh = t - 1;
                this.textBox1.Text = (Int32.Parse(ds.Tables[0].Rows[bh]["编号"].ToString()) + 1).ToString();
                //this.textBox1.Text = cmd.ExecuteScalar().ToString();
                conn.Close();
            }        private void button1_Click(object sender, EventArgs e)
            {
                if (textBox2.Text.Trim() == "" || textBox3.Text.Trim() == "" || comboBox1.Text.Trim() == "" || comboBox2.Text.Trim() == "")
                {
                    MessageBox.Show("请输入完整信息!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    string str1 = textBox3.Text.Trim();
                    int l = str1.Length;
                    for (int i = 0; i < l; i++)
                    {
                        if (!char.IsNumber(str1[i]))
                        {
                            MessageBox.Show("年龄输入有误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            textBox3.SelectAll();
                            textBox3.Focus();
                            return;
                        }
                    }
                    OracleConnection conn = new OracleConnection();
                    string str = "Data Source=oracleqq;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True";
                    conn.ConnectionString = str;
                    conn.Open();
                    OracleCommand cmd = new OracleCommand();
                    cmd.CommandText = "insert into student(编号,姓名,性别,年龄,班级)values(@编号,@姓名,@性别,@年龄,@班级)";
                    cmd.Connection = conn;
                    cmd.Parameters.Add("@编号", OracleType.Int32);
                    cmd.Parameters.Add("@姓名", OracleType.NVarChar, 50);
                    cmd.Parameters.Add("@性别", OracleType.NVarChar, 50);
                    cmd.Parameters.Add("@年龄", OracleType.Int32);
                    cmd.Parameters.Add("@班级", OracleType.NVarChar, 50);
                    cmd.Parameters["@编号"].Value = textBox1.Text.Trim();
                    cmd.Parameters["@姓名"].Value = textBox2.Text.Trim();
                    cmd.Parameters["@性别"].Value = comboBox1.Text.Trim();
                    cmd.Parameters["@年龄"].Value = textBox3.Text.Trim();
                    cmd.Parameters["@班级"].Value = comboBox2.Text.Trim();
                    conn.Close();
                    this.Close();
                }
            }        private void button2_Click(object sender, EventArgs e)
            {
                this.Close();
            }
        }