VS2010访问 oracle数据库的例子(EMP表)
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.OracleClient; using System.Data.Odbc; public partial class data : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { OracleConnection myconnection = new OracleConnection(" Data Source=ORCL;Persist Security Info=True;User ID=SCOTT;Password=tiger;Unicode=True"); myconnection.Open(); string sql = "select * from emp"; OracleCommand mycommand = new OracleCommand(sql, myconnection); OracleDataReader myReader; myReader = mycommand.ExecuteReader(); Response.Write("进入oracle自带emp表查询结果为"); Response.Write(""); Response.Write("");
用户评论
适合初者,有参考价值
虽然不是太好但是里面的还是有参考价值
正在学习oracle和pl/sql,已经入门,谢谢分享。