Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Express database (Standalone ?)
Message
De
23/08/2007 06:23:05
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01249055
Message ID:
01249789
Vues:
18
Thanks for your reply. but I try to use your method, there is some error occured.
This is my connection string.
Dim DataDirectory As String = "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data"

Dim con As SqlClient.SqlConnection = New SqlClient.SqlConnection("workstation id=DTS-1;packet size=4096;Data Source=localhost\sqlexpress;Initial Catalog=; Integrated Security=True; AttachDBFileName = '" & DataDirectory & "\DTS_AIR_DTTN.mdf'")

I am sure that I have set up the database on that directory, however, when I try to compile the program, this error occured:

Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DTS_AIR_DTTN.mdf". Operating system error 32: "32(error not found)".
An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DTS_AIR_DTTN.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Thank you very much!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform