当前位置:编程学习 > C#/ASP.NET >>

C#提示我SetModifyMode(bool)没有找到方法来重写

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace yy
{
    public partial class Form1 : Form
    {




        private void Form1_load(object sender, System.EventArgs e)
        {
            dal.SelectCommand.Parameters[0].Value = "%%";
            dal.SelectCommand.Parameters[1].Value = "%%";
            dal.SelectCommand.Parameters[2].Value = "%%";
            dal.Fill(dataSet11);
            this.cmOrders = (CurrencyManger)BindingContext[dataSet11, "yy"];
            //基类中有一个dataset11和cmOrders相连
            base.dataSet11 = this.dataSet11;//添加[药品分类]下拉菜单的下拉选项
            comboBox1.Items.Clear();
            string strConn = "workstation id=SQLEXPRESS;Integrated Security=SSPI;Database=yy;";
            SqlConnection cn = new SqlConnection(strconn);
            cn.Open();
            Sqlcommand cmd = cn.CreateCommand();
            cmd.CommandText = "select * from yy where 编号 like @编号 and 名称";
            SqlDataReader dr = cmd.ExecyuteReader();
            while (dr.Read())
            {
                comboBox1.Items.Add(dr.GetValue(0).ToString().Trim());
            }
        }
        //-----------------------根据输入信息,查询药品信息----------------------
        private void button11_Click(object sender, System.EventArgs e)
        {
            dal.SelectCommand.Parameters[0].Value = "%%";
            dal.SelectCommand.Parameters[1].Value = "%%";
            dal.SelectCommand.Parameters[2].Value = "%%";
            if (textBox1.Text != "")
                dal.SelectCommand.Parameters[0].Value = "%" + textBox1.Text + "%";
            if (textBox2.Text != "")
                dal.SelectCommand.Parameters[1].Value = "%" + textBox2.Text + "%";
            if (textBox3.Text != "")
                dal.SelectCommand.Parameters[2].Value = "%" + textBox3.Text + "%";
            dataset11.药品资料.Clear();//刷新数据集
            dal.Fill(dataSet11);
            base.dataSet11 = this.dataSet11;
        }

        //--------------------设置各个文本框的编辑属性----------------------
        protected override void SetModifyMode(bool blnEdit)
        {
            base.SetModifyMode(blnEdit);
            textBox4.ReadOnly = !blnEdit;
            textBox5.ReadOnly = !blnEdit;
            textBox6.ReadOnly = !blnEdit;
            textBox7.ReadOnly = !blnEdit;
            textBox8.ReadOnly = !blnEdit;
            textBox9.ReadOnly = !blnEdit;
            textBox10.ReadOnly = !blnEdit;
            textBox11.ReadOnly = !blnEdit;
            textBox12.ReadOnly = !blnEdit;
            textBox13.ReadOnly = !blnEdit;
            textBox14.ReadOnly = !blnEdit;
            textBox15.ReadOnly = !blnEdit;
            textBox16.ReadOnly = !blnEdit;
            textBox17.ReadOnly = !blnEdit;
            comboBox1.Enabled = blnEdit;

        }

    }
}
--------------------编程问答-------------------- 提示我SetModifyMode(bool)没有找到方法来重写 --------------------编程问答-------------------- override 去掉啊
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,