1、連接Oracle,並可以將數據庫的數據顯示在 GridControl上
string ConnectionString = "Da
OracleConnection conn=new OracleConnection(ConnectionString);
conn.Open();
OracleCommand cmd = new OracleCommand("select * from FY", conn);
OracleDataAdapter oda = new OracleDataAdapter();
oda.SelectCommand = cmd;
DataSet ds = new DataSet();
oda.Fill(ds);
gridControl1.DataSource = ds.Tables[0].DefaultView;
conn.Close();
2、修改
string ConnectionString = "Da
OracleConnection conn=new OracleConnection(ConnectionString);
conn.Open();
string str = "SQL修改語句'";
//當不傳遞conn時,會提示連接沒有打開
OracleCommand cmd1 = new OracleCommand(str,conn);
//ExecuteNonQuery()對於 Update,Insert,Delete 語句執行成功是返回值為該命令所影響的行數
int result=cmd1.ExecuteNonQuery();