Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

A Place to share c#.Net script which are useful to developers

Moderators

C#.NET Scripts

C# Script to List all SQl server databases that exists in a given SQL Server Instance

Apr 7 2012 12:00AM by Kirti M.Darji   

This script connects to a SQL Server instance and enumerates all the databases available in it.

Using This script you can list all SQL server databases

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


 public static void GetDatabaseList()
        {
           String conStr=  "Data Source=MYSERVER; User ID=Username;Password=password;";
            using (SqlConnection sqlConx = new SqlConnection(conStr))
            {
                sqlConx.Open();
                DataTable tblDatabases = sqlConx.GetSchema("Databases");
                sqlConx.Close();

                foreach (DataRow row in tblDatabases.Rows)
                {
                    Console.WriteLine(String.Format("Database Name : {0}" , row["database_name"]));
                }
            }
        }


Kirti M.Darji
10 · 16% · 4983
4
 
0
Worked
 
0
Failed
 
0
Lifesaver
 
0
Production
 
0
Unwise



Submit

Your Comment


Sign Up or Login to post a comment.

"C# Script to List all SQl server databases that exists in a given SQL Server Instance" rated 5 out of 5 by 4 readers
C# Script to List all SQl server databases that exists in a given SQL Server Instance , 5.0 out of 5 based on 4 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]