Bind DataGrid with Oracle Data Sheet

xiaoxiao2021-03-06  40

Tired, I finally found how to bind the data table to the Dategrid method. However, this time I have made an empirical mistake, I went to Google, I didn't find it for a long time, and I was found on the 9CBS community. Oh, stupid. This is Oracle version. private void button1_Click (object sender, System.EventArgs e) {string ConnectionString = "Data Source = sky; user = diamond; password = diamond;"; // write connection string OracleConnection conn = new OracleConnection (ConnectionString); // Create a new connection OracleCommand cmd = new OracleCommand ( "select * from ETAM_USERS", conn); DataSet ds = new DataSet (); OracleDataAdapter oda = new OracleDataAdapter (); oda.SelectCommand = cmd; oda.Fill (ds); conn.Close (); DG.DataSource = ds.tables [0] .defaultview;} Original source: http://community.9cbs.net/expert/topic/3364/3364261.xml? Temp = .547085

转载请注明原文地址:https://www.9cbs.com/read-85979.html

New Post(0)