连接到数据源 [英] Connecting to datasource
本文介绍了连接到数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我使用我的应用程序连接到SQL数据库,但更改了
它并想现在连接到数据源
视觉工作室.
这怎么可能?
我可以只替换我的连接字符串吗?
请提供任何帮助.
Hi all,
I used my app to connect to SQL db, I changed
it and want to connect to a datasource now in
visual studio.
How is this possible?
Can I just replace my Connection String?
Please any help would be appriciated
推荐答案
是的;您只需要将连接字符串更改为适合您的数据源的连接字符串即可.
当然,您可以在配置文件中保留许多可用的连接,然后按时间切换.如果您想在此处或在Google上进行搜索,则会有大量的文章.
Yes; you merely need to change the connection string to one that is appropraite for your data source.
Of course, you could keep a number of available connections in a config file and switch as and when. There are articles a-plenty on doing that if you care to search here or on Google.
您只需引用控件的数据源(数据集或数据表)即可.我在检索或制作CRUD命令时也会使用数据源.
像:
You will just have to cite the datasource of your control either a dataset or a datatable. I also use a datasource when im retrieving or making CRUD commands.
like:
...
Dim ds as Dataset
Listbox1.Datasource = ds
...
这篇关于连接到数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文