none
SQL Server Connexion string throw a proxy with EF RRS feed

  • Question

  • I have asked some day later about config of the EF (Entity Framework) to connect to the sql server via proxy.

    https://social.msdn.microsoft.com/Forums/en-US/387e675e-9d74-46d0-a0c3-aafdec205a24/config-entity-framework-to-use-proxy-to-connect-to-the-server?forum=adodotnetentityframework

    I don't have any replay according to my probleme. So if here we can help me please.

    So, 

    Now I want to get a StringConnexion for EF that allow proxy or the config is included to the StringConnexion.

    The connexion now is using a url,port exemple: mydb.example.com,23455 like as follow:

    connectionString="metadata=res://*/Data.DatabasesMappers.MyDBMapper.csdl|res://*/Data.DatabasesMappers.MyDBMapper.ssdl|res://*/Data.DatabasesMappers.MyDBMapper.msl;provider=System.Data.SqlClient;provider connection string="data source=tcp:mydb.mydns.com,23455;initial catalog=MyDB;user id=MyUser;password=ThePassword;MultipleActiveResultSets=True;App=EntityFramework""

    What I could add on the ConnexionString to be able to connect throw a proxy.

    Thanks


    • Moved by Bob Beauchemin Sunday, January 25, 2015 7:42 PM Moved to a more relevant forum
    Sunday, January 25, 2015 11:48 AM

Answers

All replies

  • Hi,

    What you need to do, is to ensure your connection string is something like
    	<connectionStrings>
    		<add name="conn2" connectionString="Data Source=192.?.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>
    	</connectionStrings>



    within Web.config/app.config file in your project, to ensure the project will work fine with the database.


    Many Thanks & Best Regards, Hua Min

    Sunday, January 25, 2015 12:45 PM
  • I'm using Entity Framework, it generate automatically the StringConnection. My application work file with direct internet access (direct ADSL). But in a company, they connect to the internet throw a proxy. My app don't work (Server timeout).

    So, they configure Internet Explorer or Skype. But on my app, I haven't the config of proxy. They ask me to add this functionality on my app. So I'm searching a way to configure Entity Framework or it ConnectionString to work with a proxy. 

    How can I do that ?

    Thanks

    Sunday, January 25, 2015 3:00 PM
  • You can't connect directly to SQL Server using HTTP. 

    So if you can't get a firewall rule to allow outgoing TCP/IP connections to your SQL Server, you may need to put an OData service between your application and the database server.

    David


    David http://blogs.msdn.com/b/dbrowne/

    • Marked as answer by nadjibnet Sunday, February 1, 2015 11:25 AM
    Sunday, January 25, 2015 4:24 PM
  • OK, Is it right that the Proxy can be used only for the protocol HTTP. The TCP/IP connection cannot be able pass by a proxy to connect to the server via internet ?
    • Edited by nadjibnet Sunday, January 25, 2015 4:37 PM
    Sunday, January 25, 2015 4:36 PM
  • >The TCP/IP connection cannot be able pass by a proxy to connect to the server via internet ?

    A TCP/IP connection cannot pass through a HTTP proxy.  There are TCP/IP based products that will "proxy" the traffic.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Sunday, January 25, 2015 6:31 PM