I've created a .NET solution with two projects:
ToyData (Visual Basic Class Library)
ToyOne (Visual Basic WPF Application)
The ToyData project contains Toy.edmx, an ADO.NET Entity Data Model generated from a database called Toy.
The ToyOne project contains this Window1.xaml.vb file:
1 Imports ToyData 2 3 Class Window1 4 5 Private Sub Window1_Loaded( _ 6 ByVal sender As System.Object, _ 7 ByVal e As System.Windows.RoutedEventArgs) _ 8 Handles MyBase.Loaded 9 10 Dim dc As New ToyEntities 11 Label1.Content = (From c As Client In dc.ClientSet _ 12 Select c).First 13 14 End Sub 15 16 End Class
It throws this run-time exception in the auto-generated Toy.Designer.vb file:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
What am I doing wrong?