I did this, where someone has set up two app settings; Includes a test data connection string and the second one is the live data connection string. They use the same DBML, it does not matter what real databases they point to, even when they set up a data reference, they specify the settings they want to use. I would like to implement it, but it was thinking whether a good blog post or tutorial is showing how to do it correctly, or if there is a more "out-the-box" option.
Here's what I use:
Friends All Connect (ByVal isDebugger Attachment Boolean) Dim Server String as a string in the form of slow dBNAME, then server = "DHSDEV10069 \ DSD" rest server = "dhs10073sql" meaning last if dBNAME = "DSDWorkPlanTracking" _connect = As "Data source =" & isDebuggerAttached; Server & amp; "; Database =" & amp; DbName & amp; "Integrated Security = True" _connect = _connect & amp; "; Application name =" & amp; My.Application.Info.AssemblyName End sub and in the calling class:
Try Model.instance.connect (System.Diagnostics.Debugger.IsAttached ) Try Hold & End as Exception MsgBox ("Sorry, Could not Connect to the Database" and former. Message) In addition to this, help / In:
Personal sub mnuHelpAbout_Click (System.Object as ByVal sender, System.EventArgs as ByVal E) handles mnuHelpAbout.Click Dim msg as string dim appName string as if My .Applicati On.Info.Title & lt; & Gt; "" Then appName = My.Application.Info.Title Else appName = System.IO.Path.GetFileName end without extension (My.Application.Info.AssemblyName) if msg = appName & amp; VbCrLf & amp; VbCrLf msg = msg & amp; "Version:" & amp; Application Productive version & amp; VbCrLf & amp; VbCrLf 'file version displayed in .exe properties The assembly version is for internal construction and does not need to change for a developer. Msg = msg & amp; "User:" & amp; My.User.Name & amp; VbCrLf & amp; VbCrLf message = message & amp; "Connection:" & amp; Model.instance.connection & amp; VbCrLf & amp; VbCrLf MsgBox (Message, MsgBoxStyle.OkOnly, appName) End Sub
Comments
Post a Comment