QueriesTableAdapter connection string reset

R

Roger

I have the following partial class:

Namespace DataSet1TableAdapters
Partial Class QueriesTableAdapter
Public Sub changeConnection(ByVal strConn As String)
Dim conn As New SqlClient.SqlConnection
conn.ConnectionString = strConn
Dim c As New SqlClient.SqlCommand
For Each c In Me.CommandCollection
c.Connection = conn
Next
End Sub
End Class
End Namespace

I have used this code in other windows apps successfully, however in the
current one I get an error with the line

c.Connection = conn

The error is: CommandCollection is not a member of
[Project].DataSet1TableAdapters.QueriesTableAdapter

Any ideas what's wrong??

My dataset is DataSet1.xsd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top