Forum Discussion
Daniel Westerdale
Dec 17, 2022Iron Contributor
New-Object : Cannot find type [System.Data.SqlClient.SqlSqlConnection]:
Firstly, not sure if this is the correct forum so suggest the alternative, if it isn't Anyway, I am working with a client and I am seeing a strange issue that suggests a SQL user account doe...
lounayong
Dec 17, 2022Copper Contributor
i don't have an answer for your issue but i would like to knwo what don't it means to .
Daniel Westerdale
Dec 18, 2022Iron Contributor
Not sure how I managed to mess up the syntax but once I realised I had a few typos to correct, all was good.
# switched to Windows PowerShell 5.1 and changed to integrated security, to just test the syntax
$SqlConn = New-Object System.Data.SqlClient.SqlConnection("Server = $Server; Database = $Database; Integrated Security=True")
$SqlConn.Open()
# I now have a valid connection!