ado.net,无需使用组件 [英] ado.net without using component

查看:104
本文介绍了ado.net,无需使用组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不使用组件的情况下创建ado.net连接.
我对此一无所知.
请给我建议.
我的问题:
如何在不使用组件的情况下创建ado.net连接?
请我要快速解答.

i want to create ado.net connection without using component.
i don''t have any idea about it.
please give me suggestion.
My question:
How to create ado.net connection without using components?
please i want quick answer.

推荐答案

我建​​议您可以在运行时使用oledb连接来代替ado.net组件.

这是该代码.


I suggest that instead of ado.net components you can use oledb connection at run time.

Here is code for that.


Dim dbConn As New OleDb.OleDbConnection
'Here i assume that you want to make connection with Access databse.
'If you want to make connection other then acess just change provider name.
dbConn.ConnectionString = "Provider = Microsoft.Jet.Oledb.4.0; Data Source = C:\databse.mdb"
dbConn.Open()
Dim da As New OleDb.OleDbDataAdapter("Select * from Table1", dbConn)
Dim ds As New DataSet
da.Fill(ds)



[修改:您已将预标签加倍,从而搞砸了格式.您没有看到预览吗?还删除了代码中的标签]



[Modified: you had doubled up your pre tags which was screwing up the formatting. Did you not see the preview? also removed the tabs in the code]


这篇关于ado.net,无需使用组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆