locked
local db Entityframework move To host server RRS feed

  • Question

  • User-1514772536 posted

    I am  using Entity framework local sql server working  this code generate webconfig 

    <connectionStrings>
    <add name="tickandtieEntities" connectionString="metadata=res://*/Entityframework.Tickmarks.csdl|res://*/Entityframework.Tickmarks.ssdl|res://*/Entityframework.Tickmarks.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DESKTOP-QD6A981\SQLEXPRESS;initial catalog=tickandtie;user id=sa;password=tickmarks;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings

    after finish i want move to   my server host how can i change connection string for  server  ?

    Tuesday, August 2, 2016 8:37 AM

Answers

  • User753101303 posted

    Hi,

    You'll just change DESKTOP-QD6A981\SQLEXPRESS to the proper value.

    If you are asking about how to best do that VS allows to do "config file transformation" when pusblishing so that the value you need when working on your dev box are replaced with the one needed on the hosting service. Try http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/web-config-transformations

    If you need further help some more context could help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 2, 2016 11:01 AM
  • User-2057865890 posted

    Hi thenna41,

    The following example is for a SQL Server database using SQL Server security (log on to the server by using user credentials in the connection string). The example assumes that you are connecting to the default SQL Server instance on the server.

    <add name="ConnectionStringName"
        providerName="System.Data.SqlClient"
        connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;
    User Id=userid;Password=password;MultipleActiveResultSets=True" />

    https://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx#sqlserver 

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 9, 2016 11:13 AM

All replies

  • User753101303 posted

    Hi,

    You'll just change DESKTOP-QD6A981\SQLEXPRESS to the proper value.

    If you are asking about how to best do that VS allows to do "config file transformation" when pusblishing so that the value you need when working on your dev box are replaced with the one needed on the hosting service. Try http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/web-config-transformations

    If you need further help some more context could help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 2, 2016 11:01 AM
  • User932909087 posted

    Hi thenna, .

    When you host it online, every provider have their own rule. You just need to ask them about the connection string that you need to use.

    Thursday, August 4, 2016 3:50 AM
  • User-2057865890 posted

    Hi thenna41,

    The following example is for a SQL Server database using SQL Server security (log on to the server by using user credentials in the connection string). The example assumes that you are connecting to the default SQL Server instance on the server.

    <add name="ConnectionStringName"
        providerName="System.Data.SqlClient"
        connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;
    User Id=userid;Password=password;MultipleActiveResultSets=True" />

    https://msdn.microsoft.com/en-us/library/jj653752(v=vs.110).aspx#sqlserver 

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 9, 2016 11:13 AM