日期:2014-05-16 浏览次数:20934 次
jspx.MyDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.10)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
)
private void frmVote_Load(object sender, EventArgs e)
{
//……
//加载combobox1
try
{
OracleConnection oconn = new OracleConnection(myData.conStrOracle);
oconn.Open();
string ostrSQL = "select distinct bjmc,kcmc from JXRWB_LSB where xn='" + myData.SYS_xn + "' and xq=" + myData.SYS_xq + " and jszgh='" + myData.Login_BM + "' and kclx='必修课'";
OracleCommand ocmd = new OracleCommand(ostrSQL, oconn);
OracleDataAdapter oda = new OracleDataAdapter();
oda.SelectCommand = ocmd;
oda.Fill(ds, "aa");
comboBox1.DataSource = ds.Tables["aa"];
comboBox1.DisplayMember = "bjmc";
comboBox1.SelectedIndex = -1;
myData.Login_KCName = ds.Tables["aa"].Rows[0][1].ToString().Trim();
oconn.Close();
}
catch (Exception Err)
{
MessageBox.Show(Err.Message);
}
//……
}