I should have pointed out that the New MilkywayDataContext() contained a ConnectionString parameter from My.Settings previously. I've deleted this setting and the compiler now points to this code:
How can I change the invocation to the parent constructor so it works with the connections string in the config file?Code:Imports System.Linq.Expressions Imports System.Reflection <Global.System.Data.Linq.Mapping.DatabaseAttribute(Name:="MilkywayDB")> _ Partial Public Class MilkywayDataContext Inherits System.Data.Linq.DataContext Private Shared mappingSource As System.Data.Linq.Mapping.MappingSource = New AttributeMappingSource() #Region "Extensibility Method Definitions" Partial Private Sub OnCreated() End Sub Partial Private Sub InsertBatch(instance As Batch) End Sub Partial Private Sub UpdateBatch(instance As Batch) End Sub Partial Private Sub DeleteBatch(instance As Batch) End Sub Partial Private Sub InsertUserRole(instance As UserRole) End Sub Partial Private Sub UpdateUserRole(instance As UserRole) End Sub Partial Private Sub DeleteUserRole(instance As UserRole) End Sub Partial Private Sub InsertImage(instance As Image) End Sub Partial Private Sub UpdateImage(instance As Image) End Sub Partial Private Sub DeleteImage(instance As Image) End Sub Partial Private Sub InsertIngredient(instance As Ingredient) End Sub Partial Private Sub UpdateIngredient(instance As Ingredient) End Sub Partial Private Sub DeleteIngredient(instance As Ingredient) End Sub Partial Private Sub InsertProduct(instance As Product) End Sub Partial Private Sub UpdateProduct(instance As Product) End Sub Partial Private Sub DeleteProduct(instance As Product) End Sub Partial Private Sub InsertProductIngredient(instance As ProductIngredient) End Sub Partial Private Sub UpdateProductIngredient(instance As ProductIngredient) End Sub Partial Private Sub DeleteProductIngredient(instance As ProductIngredient) End Sub Partial Private Sub InsertStatus(instance As Status) End Sub Partial Private Sub UpdateStatus(instance As Status) End Sub Partial Private Sub DeleteStatus(instance As Status) End Sub Partial Private Sub InsertUser(instance As User) End Sub Partial Private Sub UpdateUser(instance As User) End Sub Partial Private Sub DeleteUser(instance As User) End Sub #End Region Public Sub New() MyBase.New(Global.MilkywayDLL.My.MySettings.Default.MilkywayDBConnectionString, mappingSource) OnCreated End Sub




Reply With Quote