Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Netbash.Database/SqlCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public string Process(string[] args)
{ "cn|connectionstring","Returns the connectionstring name that will be used",
v=>_command=Command.ConnectionStringName},

{ "lcn|listcn","Shows all connectionstring names found",
{ "lcn|listcn","List all connectionstrings found in the config file",
v=>_command = Command.ListConnectionStrings},

{ "c=|conn=", "Name of connection string to use (defaults to first found)",
Expand Down Expand Up @@ -214,7 +214,10 @@ private SqlConnection openConnection()
var connString = getConnectionString();

var connection = new SqlConnection(connString);

if (connection.State != ConnectionState.Open)
{
connection.Open();
}
return connection;
}

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ Simple commands to query your database with NetBash. ConnectionString name can b
-t, --tables Lists tables and space used optional filter on provided table name
-s, --schema Display table schema for the provided table name
--clear Removes all rows from database
-cn --cn Returns the connectionstring that will be used
-lcn --lcn List all connectionstrings found in the config file
-c, --conn=VALUE name of connection string to use (defaults to first found)
-h, --help show this list of options


**Basic usage:**

Expand Down