SQL server connection to ASP.NET Core website2019 Community Moderator ElectionAdd a column with a default value to an existing table in SQL ServerHow to return only the Date from a SQL Server DateTime datatypeHow to check if a column exists in a SQL Server table?Check if table exists in SQL ServerHow to concatenate text from multiple rows into a single text string in SQL server?LEFT JOIN vs. LEFT OUTER JOIN in SQL ServerInserting multiple rows in a single SQL query?How do I UPDATE from a SELECT in SQL Server?How to Delete using INNER JOIN with SQL Server?What is the correct connection string for sa user in appsettings.json
Error in TransformedField
Computing the volume of a simplex-like object with constraints
The need of reserving one's ability in job interviews
I can't die. Who am I?
How to make sure I'm assertive enough in contact with subordinates?
I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?
When to use the term transposed instead of modulation?
What can I do if someone tampers with my SSH public key?
Should we avoid writing fiction about historical events without extensive research?
Deal the cards to the players
“I had a flat in the centre of town, but I didn’t like living there, so …”
Can inspiration allow the Rogue to make a Sneak Attack?
Sundering Titan and basic normal lands and snow lands
Was it really inappropriate to write a pull request for the company I interviewed with?
Can a Mimic (container form) actually hold loot?
Is divide-by-zero a security vulnerability?
Rationale to prefer local variables over instance variables?
In the world of The Matrix, what is "popping"?
The (Easy) Road to Code
Why dativ case for the verb widerspricht?
PTIJ: Aliyot for the deceased
Is this nominative case or accusative case?
An Undercover Army
Is there a math equivalent to the conditional ternary operator?
SQL server connection to ASP.NET Core website
2019 Community Moderator ElectionAdd a column with a default value to an existing table in SQL ServerHow to return only the Date from a SQL Server DateTime datatypeHow to check if a column exists in a SQL Server table?Check if table exists in SQL ServerHow to concatenate text from multiple rows into a single text string in SQL server?LEFT JOIN vs. LEFT OUTER JOIN in SQL ServerInserting multiple rows in a single SQL query?How do I UPDATE from a SELECT in SQL Server?How to Delete using INNER JOIN with SQL Server?What is the correct connection string for sa user in appsettings.json
I making a ASP.NET CORE 2.1 website. The database in Visual studio works fine, but when i deployed to the IIS which on another computer, the database not work.
In log, the error:
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'.
System.ArgumentException: Keyword not supported: 'id'.
.................
The connectionstring in the web.config:
"ConnectionStrings":
"DefaultConnection": "Server=.\SQLEXPRESS;Database=XXXX;Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;MultipleActiveResultSets=true "
,
I read lot of articles for this, but i cant add any plus tags for the connection string, wil be error, the connection string is bad?
When i run the project the in Visual Studio i can use database and i see the database in the SQL Server Managment Studio.
For the database i use the "stock database" when created a the project in visual studio.
Because i use Entity Framework i need another format connection string?
Stock Databse
c# asp.net
add a comment |
I making a ASP.NET CORE 2.1 website. The database in Visual studio works fine, but when i deployed to the IIS which on another computer, the database not work.
In log, the error:
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'.
System.ArgumentException: Keyword not supported: 'id'.
.................
The connectionstring in the web.config:
"ConnectionStrings":
"DefaultConnection": "Server=.\SQLEXPRESS;Database=XXXX;Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;MultipleActiveResultSets=true "
,
I read lot of articles for this, but i cant add any plus tags for the connection string, wil be error, the connection string is bad?
When i run the project the in Visual Studio i can use database and i see the database in the SQL Server Managment Studio.
For the database i use the "stock database" when created a the project in visual studio.
Because i use Entity Framework i need another format connection string?
Stock Databse
c# asp.net
2
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).
– Larnu
yesterday
Good to know, but if use Trusted_Connection with true, no password or Trusted_connection false with userid, and password, no connect to databse, the error message:An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOLXXXv11'.
– Bobo
yesterday
1
Sounds like the user/loginIIS APPPOOLXXXv11doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).
– Larnu
yesterday
@Lamu ,Thanks the answer for login issue.I added the permission and login issue is gone, now i got only the same error as in the question.
– Bobo
yesterday
add a comment |
I making a ASP.NET CORE 2.1 website. The database in Visual studio works fine, but when i deployed to the IIS which on another computer, the database not work.
In log, the error:
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'.
System.ArgumentException: Keyword not supported: 'id'.
.................
The connectionstring in the web.config:
"ConnectionStrings":
"DefaultConnection": "Server=.\SQLEXPRESS;Database=XXXX;Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;MultipleActiveResultSets=true "
,
I read lot of articles for this, but i cant add any plus tags for the connection string, wil be error, the connection string is bad?
When i run the project the in Visual Studio i can use database and i see the database in the SQL Server Managment Studio.
For the database i use the "stock database" when created a the project in visual studio.
Because i use Entity Framework i need another format connection string?
Stock Databse
c# asp.net
I making a ASP.NET CORE 2.1 website. The database in Visual studio works fine, but when i deployed to the IIS which on another computer, the database not work.
In log, the error:
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'.
System.ArgumentException: Keyword not supported: 'id'.
.................
The connectionstring in the web.config:
"ConnectionStrings":
"DefaultConnection": "Server=.\SQLEXPRESS;Database=XXXX;Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;MultipleActiveResultSets=true "
,
I read lot of articles for this, but i cant add any plus tags for the connection string, wil be error, the connection string is bad?
When i run the project the in Visual Studio i can use database and i see the database in the SQL Server Managment Studio.
For the database i use the "stock database" when created a the project in visual studio.
Because i use Entity Framework i need another format connection string?
Stock Databse
c# asp.net
c# asp.net
asked yesterday
BoboBobo
35
35
2
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).
– Larnu
yesterday
Good to know, but if use Trusted_Connection with true, no password or Trusted_connection false with userid, and password, no connect to databse, the error message:An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOLXXXv11'.
– Bobo
yesterday
1
Sounds like the user/loginIIS APPPOOLXXXv11doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).
– Larnu
yesterday
@Lamu ,Thanks the answer for login issue.I added the permission and login issue is gone, now i got only the same error as in the question.
– Bobo
yesterday
add a comment |
2
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).
– Larnu
yesterday
Good to know, but if use Trusted_Connection with true, no password or Trusted_connection false with userid, and password, no connect to databse, the error message:An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOLXXXv11'.
– Bobo
yesterday
1
Sounds like the user/loginIIS APPPOOLXXXv11doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).
– Larnu
yesterday
@Lamu ,Thanks the answer for login issue.I added the permission and login issue is gone, now i got only the same error as in the question.
– Bobo
yesterday
2
2
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX; doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).– Larnu
yesterday
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX; doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).– Larnu
yesterday
Good to know, but if use Trusted_Connection with true, no password or Trusted_connection false with userid, and password, no connect to databse, the error message:
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOLXXXv11'.– Bobo
yesterday
Good to know, but if use Trusted_Connection with true, no password or Trusted_connection false with userid, and password, no connect to databse, the error message:
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOLXXXv11'.– Bobo
yesterday
1
1
Sounds like the user/login
IIS APPPOOLXXXv11 doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).– Larnu
yesterday
Sounds like the user/login
IIS APPPOOLXXXv11 doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).– Larnu
yesterday
@Lamu ,Thanks the answer for login issue.I added the permission and login issue is gone, now i got only the same error as in the question.
– Bobo
yesterday
@Lamu ,Thanks the answer for login issue.I added the permission and login issue is gone, now i got only the same error as in the question.
– Bobo
yesterday
add a comment |
2 Answers
2
active
oldest
votes
Oh my jesus... I figured out the answer.. Just one f*... word... In connenction strig DONT USE database, the correct word is Initial Catalog and maybe use user id instead of id.
Correct string:
"DefaultConnection": "Server=.\SQLEXPRESS;Initial Catalog=XXX;Trusted_Connection=False;user id=XXX;pwd=XXX;MultipleActiveResultSets=true "
add a comment |
Based on my research if the server have morethan one databases .net core suffers to identify if the dabtase is mentioned in connection string.
This is not a problem if you use .Net framework, instead of .Net Core.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55022363%2fsql-server-connection-to-asp-net-core-website%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Oh my jesus... I figured out the answer.. Just one f*... word... In connenction strig DONT USE database, the correct word is Initial Catalog and maybe use user id instead of id.
Correct string:
"DefaultConnection": "Server=.\SQLEXPRESS;Initial Catalog=XXX;Trusted_Connection=False;user id=XXX;pwd=XXX;MultipleActiveResultSets=true "
add a comment |
Oh my jesus... I figured out the answer.. Just one f*... word... In connenction strig DONT USE database, the correct word is Initial Catalog and maybe use user id instead of id.
Correct string:
"DefaultConnection": "Server=.\SQLEXPRESS;Initial Catalog=XXX;Trusted_Connection=False;user id=XXX;pwd=XXX;MultipleActiveResultSets=true "
add a comment |
Oh my jesus... I figured out the answer.. Just one f*... word... In connenction strig DONT USE database, the correct word is Initial Catalog and maybe use user id instead of id.
Correct string:
"DefaultConnection": "Server=.\SQLEXPRESS;Initial Catalog=XXX;Trusted_Connection=False;user id=XXX;pwd=XXX;MultipleActiveResultSets=true "
Oh my jesus... I figured out the answer.. Just one f*... word... In connenction strig DONT USE database, the correct word is Initial Catalog and maybe use user id instead of id.
Correct string:
"DefaultConnection": "Server=.\SQLEXPRESS;Initial Catalog=XXX;Trusted_Connection=False;user id=XXX;pwd=XXX;MultipleActiveResultSets=true "
answered yesterday
BoboBobo
35
35
add a comment |
add a comment |
Based on my research if the server have morethan one databases .net core suffers to identify if the dabtase is mentioned in connection string.
This is not a problem if you use .Net framework, instead of .Net Core.
add a comment |
Based on my research if the server have morethan one databases .net core suffers to identify if the dabtase is mentioned in connection string.
This is not a problem if you use .Net framework, instead of .Net Core.
add a comment |
Based on my research if the server have morethan one databases .net core suffers to identify if the dabtase is mentioned in connection string.
This is not a problem if you use .Net framework, instead of .Net Core.
Based on my research if the server have morethan one databases .net core suffers to identify if the dabtase is mentioned in connection string.
This is not a problem if you use .Net framework, instead of .Net Core.
answered yesterday
BharathBharath
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55022363%2fsql-server-connection-to-asp-net-core-website%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).– Larnu
yesterday
Good to know, but if use Trusted_Connection with true, no password or Trusted_connection false with userid, and password, no connect to databse, the error message:
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOLXXXv11'.– Bobo
yesterday
1
Sounds like the user/login
IIS APPPOOLXXXv11doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).– Larnu
yesterday
@Lamu ,Thanks the answer for login issue.I added the permission and login issue is gone, now i got only the same error as in the question.
– Bobo
yesterday