can any one help me how to connect database in oracle and the connection string in c# -
protected void page_load(object sender, eventargs e) { oracleconnection con = new oracleconnection(); con.connectionstring = "user id =test;password=test1;datasource=oracle"; myconnection.open(); }
above code using. called on page_load.
string oradb = "user id =test;password=test1;datasource=oracle"; oracleconnection conn = new oracleconnection(oradb); conn.open(); using (oracledataadapter = new oracledataadapter( "select id emp1", conn)) { datatable t = new datatable(); a.fill(t); // render data onto screen datagridview1.datasource = t; } conn.dispose();
Comments
Post a Comment