aram

Untitled

Apr 13th, 2011
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. using System.Data.SqlClient;
  7. using System.Data.Sql;
  8. namespace TestSql
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.  
  15.             SqlConnection con = new SqlConnection(
  16.                  "Data Source=(local);Initial Catalog= Student;Integrated Security=SSPI");
  17.        
  18.                
  19.                 con.Open();
  20.                // DataTable table = con.GetSchema("Databases");
  21.                 con.Close();
  22.                // foreach (DataRow row in table.Rows)
  23.                // {
  24.                //     Console.WriteLine("Database: " + row["database_name"]);
  25.                //}
  26.        
  27.            
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment