0

I made a windows form app witch uses sql server as it's database . In my own system, my app is working great with no errors but when I run it in another system it gives me the error - "login failed for user [MyUserName]"

Also I used sql authentication to attach to my database

Here is my connection string

    string connectionSt = "Initial Catalog = IndustryContracts; Uid=****;Pwd=****";
Loathing
  • 5,109
  • 3
  • 24
  • 35
Feri
  • 11
  • 5

1 Answers1

0

Witch you Database use ? MS Sql Server Or LocalDb ?

LocalDb: must change connection string after publish More Info


Sql Server: you mus install MS Sql server each PC you want install your app and Resturn your database

I Suggest you use sa user for Login Sql server in connectionString, Enable sa user

Zanyar Jalal
  • 1,407
  • 12
  • 29
  • I used sql server as localDB. – Feri Sep 25 '20 at 20:07
  • for localDb not use User and change your app config like this https://stackoverflow.com/a/62052743/12777835 use LocalDb in WinForm C# ==> https://www.c-sharpcorner.com/UploadFile/7d3362/use-local-database-file-in-window-application-C-Sharp/ – Zanyar Jalal Sep 26 '20 at 07:26