Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VS Crashes When Creating Business Object
Message
De
04/03/2006 21:38:15
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01101084
Message ID:
01101546
Vues:
10
Thank you all for your input. I have solved the problem (at least for my installation).

Summary
Fresh installation of VS 2005, MM .Net2005, SQL Express
I could not connect using any connection string in app.cofig.
I could connect to SQLExpress via command line osql.
I could connect using the VS VS GUI interfaces, "Add New Data Source" or via the "Server Explorer" to Northwind.
After achieving a NW connection from a VS GUI interface, I did copy the connection string and paste it into app.config, without success (and even after modify the string in many ways).

Solution
Install SQL Express with a mixed mode authentication.
Download from MS the Northwind sample databases. Run instnwnd.sql.
In app.config, use a connection string similar to this:
<add key="Northwind\Connection" value="server=.\SQLEXPRESS;uid=sa;pwd=SA1234;database=NorthWind" />
Note that (local) did not work. NT Authority logons did not work. Using a named instance (.\SQLExpress) did work.

The development machine was not connected to a domain controller which appears to have caused problems with the SQL NT Authority logon. Also, at least from MM .Net, you must create a reference to Northwind in the default SQLExpress master table. This is acomplished by using the MS provide script mentioned above.

Discussion
With SQL Express, Northwind is no longer installed as a sample database. However Northwind can be obtained by downloading an msi from Microsoft. The msi installs a Northwind instance in a separate folder, "Microsoft SQL Server 2000 Sample Database". The folder contains the Pubs sample and Northwind to be attached to SQL Server (notice not SQL Express). It also contains scripts to create Northwind.

Connection to Northwind via VS GUI always results in the connection string containing a attach database command. As mentioned, this string works via the GUI interface and from osql, but NOT when used in the app.config file.

An attempt was made to create the databases in the named instance SqlExpress using osql. This fails with an error message that the osql implemenation in SQL Express does not contain all of the command features of SQL Server.

The last effort was the one that worked (funny how it always works out that way!). Runing the script file in Northwind download "instnwnd.sql" installed a newly created Northwind.

After this step, the sa connection string worked just find.

Don Lowrey
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform