尝试在运行时编辑Connectionstring [英] Trying to edit Connectionstring at runtime

查看:81
本文介绍了尝试在运行时编辑Connectionstring的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


有人建议我下面的代码来编辑我的连接字符串.但这是返回错误
在第一行.我是否需要在命名空间中导入某些内容?

Hi,
I was suggested the code below to edit my connectionstring. But it is returning error
on first line. Do I need to import something in the namespace?

Dim adapter As New dbTestSharingDataSet.tblTestTableAdapter
Dim conn As New SqlConnection()
conn.ConnectionString = MyConnectionManager.ConnectionString
adapter.Connection = conn
Dim table As DataTable = adapter.GetData()




谢谢




Thanks

推荐答案

取决于:

您从哪里获得dbTestSharingDataSet?
它包含tblTestTableAdapter吗?

如果这些在您的项目中,那么不,您不应该.
如果不是,那么您可能需要在项目中添加引用.
Depends:

Where do you get dbTestSharingDataSet from?
Does it contain tblTestTableAdapter?

If these are within your project, then no, you shouldn''t.
If they aren''t, then you may well need to add a reference in your project.


这篇关于尝试在运行时编辑Connectionstring的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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