$connection = New-object -TypeName System.Data.SqlClient.SqlConnection $connection.ConnectionString = "Server=localhost\SQLEXPRESS;Database=admindata;Trusted_Connection=True;" $connection.open()
I am using windows 10 terminal and I have SQL server 2012 Express installed on my laptop. I am practicing the Nugget by Don Jones which is on Uploading information from powershell to SQL server. Problem I am facing is that I am not able to open the connection .Connection object gets created but it is in closed status. If I try to open the connection object using open() method it gives me below error.
Exception calling “Open” with “0” argument(s): “Arithmetic operation resulted in an overflow.”
At line:1 char:1
- $connection.Open()
-
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : OverflowException