Note that there are some explanatory texts on larger screens.

plurals
  1. POSet TCP/IP protocol enable for SQL Server 2008 r2 in C#
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2266697/changing-sql-server-settings-programmatically">Changing SQL Server settings programmatically</a> </p> </blockquote> <p>To setup a network connection between client C# application and SQL Server 2008 R2 I know what should manually do, my problems is how to do following steps in the C# code!</p> <ol> <li>Set TCP/IP protocol Enabled for a server instance like <code>MSSQLSERVERR2</code>.</li> <li><p>Restart my SQL Server engine.</p> <p>I can do the other steps by SQL queries:</p></li> <li><p>Add User and grant admin permission.</p> <pre><code>CREATE LOGIN momtahen WITH PASSWORD = '123' EXEC master..sp_addsrvrolemember @loginame = N'momtahen', @rolename = N'sysadmin' </code></pre></li> <li><p>Set mixed authentication mode for my SQL Server.</p> <pre><code>EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2 </code></pre></li> </ol> <p>I need C# code or SQL query that I could execute using C#.</p> <p>Also I have to mention that I have seen following question and no help yet!</p> <ul> <li><a href="https://stackoverflow.com/questions/9138172/enable-tcp-ip-remote-connections-to-sql-server-express-already-installed-databas">Enable tcp\ip remote connections to sql server express already installed database with code or script(query)</a></li> <li><a href="https://stackoverflow.com/questions/9137836/enable-remote-connections-to-sql-express-with-a-script/9154540#9154540">Enable remote connections to sql express with a script</a></li> <li><a href="https://stackoverflow.com/questions/2499957/what-are-registry-settings-to-enable-tcp-on-sql-server-2005-and-2008">what are registry settings to enable TCP on SQL Server 2005 and 2008?</a></li> </ul> <p>Thanks to them by the way. So any Idea?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload