vs2008 c#开发windows窗体程序,怎么连接数据库
1个回答
展开全部
using(OracleConnection Con = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.20)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ora9i.com)));User Id=123;Password=123;"))
{
OracleCommand CmdObj = new OracleCommand(OraCmd, Con);
OracleDataAdapter dataAdapter = new OracleDataAdapter(OraCmd, Con);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
}
或
OracleConnection con = new OracleConnection("Data Source=AA;Persist Security Info=True;User ID=123;Password=123;Unicode=True");
{
OracleCommand CmdObj = new OracleCommand(OraCmd, Con);
OracleDataAdapter dataAdapter = new OracleDataAdapter(OraCmd, Con);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
}
或
OracleConnection con = new OracleConnection("Data Source=AA;Persist Security Info=True;User ID=123;Password=123;Unicode=True");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询