Using:
* LLBLGEN Pro 2.6 Final August 18th 2008
* NET20 ORM Runtime library 2.6.8.819
* Silverlight application, WebService and Data Transfer Objects created with the LLBLGEN DTO templates.
Problem:
I am trying to change the selected database from within the webservice application.
After some struggling (web.config, sqlServerCatalogNameOverwrites, publickeytoken, etc) I managed to do so. But ... only in the sub New of the webservice class:
Public Sub New()
Dim sConnectionString As String = "data source=MYSERVER;initial catalog=MYOTHERDATABASE;User ID=MYUSER;Password=MYPWD;persist security info=False;packet size=4096"
myDA = New QBODTO.DatabaseSpecific.DataAccessAdapter(sConnectionString)
End Sub
What I want is to pass the new databasename from my Silverlight app to the webservice app in order to switch to another database. Tried this via a web method, but it doesn't seem to work that way:
<WebMethod()> _
Public Function LogIn(ByVal sDatabase As String) As Boolean
Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder(myDA.sConnectionString)
builder.InitialCatalog = sDatabase
myDA.ConnectionString = builder.ConnectionString
End Function