Accu Web Hosting Accu Web Hosting Accuweb Hosting
Accu Web Hosting Accu Web Hosting Window Hosting Home Accu Web Hosting Window Hosting Accu Web Hosting PHP Hosting Accu Web Hosting Reseller Accu Web Hosting SQL Hosting Accu Web Hosting   accu web hosting
 

Go Back   Web Hosting Technical Support Discussion Forum > General Information - Discussion and Recent Issues > TroubleShooting

TroubleShooting General Trouble Shooting Examples

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 06-30-2006
Senior Member
 
Join Date: May 2005
Location: (.)
Age: 25
Posts: 144
Rep Power: 0
Manuel_ is on a distinguished road
Send a message via MSN to Manuel_
Default


This C# function helps you check if SQL Server is running fine on a particular server and port. Useful to use on app startup, or for troubleshooting firewall problems after a Windows SP2 installation.

using System.Net;
using System.Net.Sockets;

public bool CheckSQLServer(string SQLHost, int SQLPort)
{
try
{
IPHostEntry IPHost = new IPHostEntry();
IPHost = Dns.Resolve(SQLHost);

IPAddress IPAddr = IPHost.AddressList[0];

TcpClient TcpCli = new TcpClient();
TcpCli.Connect(IPAddr, SQLPort);
TcpCli.Close();

return true;
}
catch
{
return false;
}
}
__________________
Strat with Linux || Optimize, Secure and increase performance of Apache || Already Started
The visionary conceives the impossible, The missionary makes it possible. ...Gita.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SMTP Command to check Email Connections. Manuel_ TroubleShooting 0 06-25-2006 11:45 AM
Prevent the IIS SMTP Virtual Server from Relaying E-mail Messages Manuel_ Windows Dedicated Servers 0 06-22-2006 04:36 PM
Configure SQL database in MS Enterprise Manager Manuel_ Windows Web Hosting Discussion Forum 0 06-03-2006 05:58 AM
Move large domain to new server Manuel_ TroubleShooting 0 06-03-2006 05:39 AM


All times are GMT -5. The time now is 08:47 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC5
http://www.accuwebhosting.com/terms.htm

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31