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










0















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










share|improve this question

















  • 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 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















0















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










share|improve this question

















  • 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 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













0












0








0


1






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










share|improve this question














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 sql-server database-connection connection-string






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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/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












  • 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 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







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












2 Answers
2






active

oldest

votes


















0














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 "





share|improve this answer






























    0














    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.






    share|improve this answer






















      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
      );



      );













      draft saved

      draft discarded


















      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









      0














      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 "





      share|improve this answer



























        0














        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 "





        share|improve this answer

























          0












          0








          0







          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 "





          share|improve this answer













          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 "






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          BoboBobo

          35




          35























              0














              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.






              share|improve this answer



























                0














                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.






                share|improve this answer

























                  0












                  0








                  0







                  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.






                  share|improve this answer













                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  BharathBharath

                  13




                  13



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

                      Алба-Юлія

                      Захаров Федір Захарович