Tried many things to fix this SqlClient exceptions, but no hope
It is a started project given to me, and I have to run the project first, and then exectue the stored procedures. We are using SQL Server for this.
I am facing the below error as I run the project
And when I manually create the database instead of relying on the project to create it, I get the below error which I think is looking for the table:
I tried with windows authentication as well as sql server authentication by creating new logins, but it keeps resulting on the same error.
It is working for them, it is just not working on my pc. What are the possible things I could do to fix this issue? Thank you!
8 Replies
do you have the relevant permissions for database_name?
your login can be valid and just not have the required permissions, both via windows auth and sql server auth
They said just run the project and it will create the database as well.
but after creating the db, manually, and giving my login the db owner and all the other permissions, I face this error:
if they're saying the project will create the database, i'm not sure why you would make the DB manually
it sounds like they're expecting the code to run migrations on startup
it's hard for me to give advice on that front without seeing the code
yeah, they are expecting that. Do you think SQL Server might behave differently from system to system, or the way they are describing it will work just accidently somehow worked?
I am requesting the backup of the db to load it on my side to avoid all these issues. I hope this will fix it, but if not, I am cooked
it depends on where the sql server instance lives... if it's running in a docker container then everything should be close to deterministic.
but if it's a real instance living on a server somewhere, all bets are off lol.
are you able to connect to the server through SSMS/azure data studio/etc.?
I am able to connect to it through SSMS
and it is not running on docker container.. it is just directly on my pc now
so the same login works in SSMS, but not in your app code?
hmm
is your app using a valid connection string (the same as you're using in SSMS)?
This is what I am using
I am also logging in with the window's authentication on SSMS