Hi I am using WinAppSDK WinUI 3 framework. I created a Service Based-Database and in it I created a table. Now when I run the app I am getting this:
Hi I am using WinAppSDK WinUI 3 framework. I created a Service Based-Database and in it I created a table. Now when I run the app I am getting this:
Hi @HemanthB-9452,
Any update for this thread? Did the reply(s) could help you? If the response helped, do "Accept Answer". If you have further question, please feel free to let us know.
But in your connection string you use "AttachDbFilename" for a SQL Server User-Instance; not service based DB: it should be "Initial Catalog" or "Database" parameter instead.I created a Service Based-Database
Hi @HemanthB-9452,
According to your error message, please just to be sure check again your database server as it might already contain a database with the same name. Or please check if the file location of this database is correct.
In addition, please check if the parameters of your connection string is right. Please check below blog to get more.
An attempt to attach an auto-named database for file ....database1.mdf failed
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
7 people are following this question.