如何在 vb.net 中使用 OLE DB 更改 Crystal Reports 连接字符串?
我有一个“Connection.vb”,其中存储了我的所有连接字符串并由整个程序使用。
我是 Crystal Reports 的新手..我想根据我创建的连接字符串更改其连接字符串...我使用 MS SQL 2008..SQL Server Native Client 10.0 OLE DB Provider..
这是我的连接字符串。 “Provider=SQLNCLI10;Server=....\SQLEXPRESS;Database=Blah;Trusted_Connection=yes”
我试图用谷歌搜索它..但他们使用不同的语言,不同的数据库和复杂的示例...
提前感谢..
i have a "Connection.vb" where all my Connection string stored and used by the entire program.
i'm new to Crystal Reports.. and i want to changes its connection string based on the connection string i made... im using MS SQL 2008.. SQL Server Native Client 10.0 OLE DB Provider..
and here is my connection string.
"Provider=SQLNCLI10;Server=....\SQLEXPRESS;Database=Blah;Trusted_Connection=yes"
i tried to google it.. but they are using different language, different database, and complex examples...
thanks in advance..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚花了一些时间在 VB 中解决这个确切的问题。我希望这有帮助。
将 YourDataContext() 替换为您的数据上下文。或者,您可以照常从 AppConfig 获取连接字符串。我从数据上下文中获取我的数据,因为我们正在迁移数据库并不断更改连接字符串。
I just spent some quality time figuring out this exact problem, in VB. I hope this helps.
Replace YourDataContext() with whatever your data context is. Alternatively, you can get the connection string from the AppConfig as usual. I am getting mine from the data context because we are migrating databases and keep changing the connection strings.