如何引用ORACLE.DATAACCESS.DLL-CSDN论坛
展开全部
(1)控件法:
把控件OleDbDataAdapter放到窗体上,然后进行配置
它会自动给OleDbConnection
在OleDbDataAdapter控件上右键,生成数据集DataSet
把控件OleDbCommand也放上
最后为了显示数据,放上DataGrid,配置他的DataSource和DataMumber
这样如果配置正确了就可以进行简单的数据显示了
(2)代码连接:
Dim str4 As String
Dim connection2 As OleDbConnection
Dim adapter As New OleDbDataAdapter
str4 = "select * from dept"
connection2 = New OleDbConnection"Provider=OraOLEDB.Oracle.1;User ID=scott;Data Source=hong;Password=tiger")
adapter = New OleDbDataAdapter(str4, connection2)
Dim DataSet21 As DataSet = New DataSet
adapter.Fill(DataSet21, "dept")
把控件OleDbDataAdapter放到窗体上,然后进行配置
它会自动给OleDbConnection
在OleDbDataAdapter控件上右键,生成数据集DataSet
把控件OleDbCommand也放上
最后为了显示数据,放上DataGrid,配置他的DataSource和DataMumber
这样如果配置正确了就可以进行简单的数据显示了
(2)代码连接:
Dim str4 As String
Dim connection2 As OleDbConnection
Dim adapter As New OleDbDataAdapter
str4 = "select * from dept"
connection2 = New OleDbConnection"Provider=OraOLEDB.Oracle.1;User ID=scott;Data Source=hong;Password=tiger")
adapter = New OleDbDataAdapter(str4, connection2)
Dim DataSet21 As DataSet = New DataSet
adapter.Fill(DataSet21, "dept")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询