我有一个链接为“dtschool.dbml”的数据库,我想在运行此代码时在SQLServer中创建此数据库
Dim dt As New SchoolData.linqSchoolsDataContext
Dim sd As New SqlClient.SqlConnectionStringBuilder
sd.DataSource = "LAPTOP-AJM33RB1\TESTSERVER"
sd.IntegratedSecurity = True
dt.Connection.ConnectionString = sd.ConnectionString
dt.Connection.Open()
dt.CreateDatabase()
我看到了这个错误
System.Data.SqlClient.SqlException: 'CREATE FILE encountered operating system error 123(The filename, directory name, or volume label syntax is incorrect.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL13.TESTSERVER\MSSQL\DATA\|DataDirectory|_Database_Schools_dtSchools.mdf.mdf'.
创建数据库失败。无法创建列出的某些文件名。“检查相关错误。”
错误
1条答案
按热度按时间gkl3eglg1#
使用此方法