Closed IonutDanNica closed 5 years ago
@IonutDanNica -- the command Get-SqlConnection
is rarely used... only necessary when you need to drop into pure .Net and want the underlying Connection Object. That being said...
Whenever you create a connection Open-*Connection
and use the parameter -ConnectionName, then for any other command you want to use with that connection, you must pass in the ConnectionName. For example:
$FilePath = "C:\Users\inica\Documents\result.db"
Open-SQLiteConnection -FilePath $FilePath -ConnectionName foo
Show-SqlConnection -ConnectionName foo
Close-SqlConnection -cn foo #using the alias for ConnectionName which is CN
Open-SqlConnection #openning MSSQL connection with all default parameters
Show-SqlConnection
Show-SqlConnection -CN default # this will do the same thing.. because when you open a connection and don't specify -ConnectionName, then the name 'default' is assigned automatically.
I'm pretty new to SimplySQL but I can't seem to be able to open a connection to a database file when using the ConnectionName parameter. Here's an example
When using the commandlet without the connectionName paramter a connection is opened
Is this normal, or am I doing something wrong?