日期:2010-12-26  浏览次数:21111 次

这段代码我没整理过,希望哪位整理一下重新贴上来

using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.Globalization;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data.SqlClient;

namespace ComboBoxInDataGrid
{
    public class Form2:System.Windows.Forms.Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private SqlDataAdapter sqlDA;
        private SqlCommand sqlSelectStudent;
        private SqlCommand sqlInsertStudent;
        private SqlCommand sqlUpdateStudent;
        private SqlCommand sqlDeleteStudent;
        private System.ComponentModel.Container components = null;
        private string StrSQL;
        private SqlConnection sqlConn;
        private DataSet _StudentDS;
        private DataTable _CourseDT;
        private DataGridTableStyle GridTableStyle;
        private System.Windows.Forms.Button btnUpdate;
        private System.Windows.Forms.Button btnMoveFirst;
        private System.Windows.Forms.Button btnMovePrevious;
        private System.Windows.Forms.Button btnMoveNext;
        private System.Windows.Forms.Button btnMoveLast;
        private System.Windows.Forms.DataGrid dataGrid1;
        private System.Windows.Forms.Label label1;
        private CurrencyManager objStudentCM;
        public Form2()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (components != null)
                {
                    components.Dispose();