我有一个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
}