Sirs, I made the most simple connection sample to try the data access application block.
But it appears I'm mading a obvius mistake and it's not working.
Can you please take a look for me and tell me wha'ts wrong?
VB.NET, on my form:
Private Sub dbConnect()
Dim db As SqlDatabase = New SqlDatabase("Data Source=myServer; Initial Catalog=EntLibQuickStarts;Integrated Security=SSPI;")
If CType(db.ExecuteScalar(Data.CommandType.Text, "SELECT COUNT(*) FROM Customers"), Integer) = 0 Then
Throw New Exception("Error")
Private Sub frmPrincipal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If I run the program, on the line db.ExecuteScalar I receive an error: SqlException was unhandled: can't connect to SQL Server. Server not found...
MyServer is a valid SQL Server 2008 remote server.
If I try the code using regular SQLClient library, it works.