有个小问题,请大家帮忙!
下面代码中“ComboBox”控件选项一改变,输入框内容也随之改变,主要是“ComboBox”并没有“SelectedIndexChanged”事件,这是什么原因???
/* This is the second version of "how to populate the data
* from a table in a ComboBox" program.
* here is used :
-TableMapping mechanism
which controls how data adapters copy tables and columns of data
from a physical data source to ADO.NET in-memory objects
-DataViewManager
which binds a control to more than one table of a DataSet
* H黶eyin Altindag 18.07.2004
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data;
namespace HowToGetDataIntoComboBox2
{
/// <summary>
/// Summary description for Form2.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private OleDbConnection myConn;
private OleDbDataAdapter dAdapter;
private DataViewManager dviewmanager;
private DataSet dset;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
fnGetConnectedToDatabase();
//
// TODO: Add any constructor code after InitializeComponent call
//
}