Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?

VB
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
Posted
Updated 21-Jan-12 22:49pm
v2

1 solution

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.
 
Share this answer
 
Comments
Furqan Sehgal 22-Jan-12 4:20am    
Yes it contains tblTestTableAdapter and also they are in my project.
Furqan Sehgal 22-Jan-12 4:21am    
Please visit this link
http://stackoverflow.com/questions/8951372/need-to-change-connection-string-on-client-computer-at-run-time

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900