, 나는 형 'System.Data.MissingPrimaryKeyException'의 예외가 system.data.dll에서 발생미스 기본 키는
오류를 얻을 사용자 코드에서 처리되지 않았습니다.
이유를 모르거나 수정하는 방법을 모르겠습니다.
string csv_file_path = @"C: \Users\xxx\Desktop\xxxx.csv";
DataTable csvData;
.....
DataColumn[] primaryKeys;
primaryKeys = csvData.PrimaryKey;
.....
private void Watcher_Received(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args)
{
if (args.RawSignalStrengthInDBm > -100)
{
if (csvData.Rows.Find(args.BluetoothAddress.ToString()) != null)
// got the error
{
DataRow infoRow = csvData.Rows.Find(args.BluetoothAddress.ToString());
if (infoRow[1] != null)
{
// Display Location information
this.Dispatcher.Invoke((Action)(() =>
{ textBox.Text = ("Location: " + infoRow[2].ToString() + ", Time: " + DateTime.Now.ToString("h:mm:ss tt")).ToString(); }));
}
else
{
// record other information
........
}
}
}
}
예외를 던지고있는 라인을 지적 할 수 있습니까? – RBT
if (csvData.Rows.Find (args.BluetoothAddress.ToString())! = null). 이 줄에 오류가 있습니다. – QuickLearner