使用“ 1”参数调用“ fill”的异常:“无效的对象名称** TableName **”

时间:2019-06-25 13:26:17

标签: mysql sql .net powershell

我有一个sql查询来获取我从csv获得的特定批号的打印日期,我得到一个错误提示

"Exception calling "fill" with "1" arguments: Invalid object name someTableName"

我已经编写了查询,并且一直试图将其添加到表中以进行检索。我收到上述错误

*****此之前的SQL连接******

$sqlCommand1 = New-Object System.Data.SqlClient.SqlCommand
$sqlCommand1.Connection = $sqlConnection
$SqlCommand1.CommandText = "SELECT log.FINDATE 
                            FROM JS_BATCHES  log 
                            WHERE BATCHID ='$firstElement'" //obtained this from csv

$sqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$sqlAdapter.SelectCommand=$sqlCommand1
$dataset=New-Object System.Data.DataSet

$sqlAdapter.Fill($dataset)
$sqlConnection.Close();
$wholeData=$dataset.Tables[0]


foreach($row in $wholeData) 
{
  $value=row.FINDATE
}

0 个答案:

没有答案