Miscellaneous changes. Keep original end of line characters.
This commit is contained in:
29
ServerExplorer/Code/DataAccess/DatabaseDA.cs
Normal file
29
ServerExplorer/Code/DataAccess/DatabaseDA.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using ServerExplorer.Code.DataTransfer;
|
||||
|
||||
namespace ServerExplorer.Code.DataAccess
|
||||
{
|
||||
class DatabaseDA
|
||||
{
|
||||
public static List<Database> Database_GetRegs(string conexionString)
|
||||
{
|
||||
var databases = new List<Database>();
|
||||
var cnx = new SqlConnection(conexionString);
|
||||
cnx.Open();
|
||||
DataTable dt = cnx.GetSchema("Databases");
|
||||
cnx.Close();
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
databases.Add(new Database
|
||||
{
|
||||
Name = (String) dr["database_name"],
|
||||
CreateDate = (DateTime) dr["create_date"]
|
||||
});
|
||||
}
|
||||
return databases;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user