WorkstationId : SqlConnection : Database C# Source Code


Custom Search

C# Source Code » Database » SqlConnection »

 

WorkstationId








    
 
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;

class MainClass {
    public static void Main() {
        using (SqlConnection con = new SqlConnection()) {
            con.ConnectionString = @"Data Source=.\sqlexpress;Database=Northwind;Integrated Security=SSPI";    

            con.Open();

            if (con.State == ConnectionState.Open) {
                Console.WriteLine("  Workstation Id = " + con.WorkstationId);
            } else {
                Console.WriteLine("SqlConnection failed to open.");
                Console.WriteLine("  Connection State = " + con.State);
            }

        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Database
» SqlConnection