Error adding tableadapter to dataset

I am developing a winforms application in Vb.net when I try to add a tableadapter to an existing dataset, I get an error:

Failed to open database connection. Msgstr "Failed to create a database with auto-name for file ### Filelocation ###. A database with the same name exists or the specified file cannot be opened or is located on the UNC shared folder." Check the connection and try again.

In the same dataset, there are 2 other table adapters that use the same connection (since I select an existing dataconnection connection) that work fine, this connection uses application connection strings:

Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\test.mdf;Integrated 
server=localhost;user id=root;password=password;database=testuser;persistsecurityinfo=True

this error appears every time I select the dataconnector in the first popup. Why is this happening

Additional Information: The other 2 table adapters were added to this dataset using a different computer. This is for connecting mysql

+3
source share
3 answers

the file is a .mdf file, so it is an mssql file

I assume that since you stated that you are using mysql, the connection string should be a little different and therefore the dataset cannot connect to Mysql

0
source

Try adding User Instance=True;to the connection string.

0
source

MSDN:

.... \aspnetdb.mdf

, - DonBoitnott , User Instance=True;. , , Luke A.

" , , . " ... " : MDF, TCP/IP , / UserInstance ( , ), , , .

. / , , , ... , , .

_ , App_Data , , SQL Express ( , ) . VS , - IIS/SQLExpress . ( IIS, ) . , , , ".

: Initial Catalog=uniquenamehere .

"... where 'uniquenamehere' is some name for your project.", uniquenamehere , .

0
source

All Articles