Exception calling "Open" with "0" argument(s): "Cannot open database "Quanlymanguon" requested by the login. The login failed. Login failed for user 'ladadbm'." At D:\Media\r_2e87618a.ps1:4 char:1 + $conn.Open() + ~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : SqlException Exception calling "ExecuteReader" with "0" argument(s): "ExecuteReader requires an open and available Connection. The connection's current state is closed." At D:\Media\r_2e87618a.ps1:7 char:1 + $rd=$cmd.ExecuteReader() + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:9 char:7 + while($rd.Read()){$cnt++;Write-Output $rd[0]} + ~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:10 char:1 + $rd.Close() + ~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull ---tables: 0--- Exception calling "ExecuteReader" with "0" argument(s): "ExecuteReader requires an open and available Connection. The connection's current state is closed." At D:\Media\r_2e87618a.ps1:13 char:1 + $rd=$cmd.ExecuteReader() + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:15 char:7 + while($rd.Read()){$cols+=$rd[0]+"|"} + ~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:16 char:1 + $rd.Close() + ~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull user_cols: Exception calling "ExecuteReader" with "0" argument(s): "ExecuteReader requires an open and available Connection. The connection's current state is closed." At D:\Media\r_2e87618a.ps1:19 char:1 + $rd=$cmd.ExecuteReader() + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:20 char:7 + while($rd.Read()){$row="";for($i=0;$i -lt $rd.FieldCount;$i++){if($i ... + ~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:21 char:1 + $rd.Close() + ~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "ExecuteScalar" with "0" argument(s): "ExecuteScalar requires an open and available Connection. The connection's current state is closed." At D:\Media\r_2e87618a.ps1:23 char:1 + $cnt=$cmd.ExecuteScalar() + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException ---repos: 0--- Exception calling "ExecuteReader" with "0" argument(s): "ExecuteReader requires an open and available Connection. The connection's current state is closed." At D:\Media\r_2e87618a.ps1:26 char:1 + $rd=$cmd.ExecuteReader() + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:27 char:7 + while($rd.Read()){$row="";for($i=0;$i -lt $rd.FieldCount;$i++){if($i ... + ~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At D:\Media\r_2e87618a.ps1:28 char:1 + $rd.Close() + ~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull