我想更新我的数据库表中的两列。
下面是我用来遍历数据网格以获取商店地址的代码。在我使用 GetGoogleSearch 方法搜索 GPS 坐标的数据库中。
然后我从互联网上获取 GPS 坐标,并将它们放入数据表中。
我现在想更新列并放入我找到的数据并更新列,因为它们当前为数据库中的坐标经度和纬度设置为 NULL。
下面是用于迭代和获取 GPS 坐标的代码。
折叠 | 复制代码
private void btnMapStoreAddresses_Click(object sender, EventArgs e)
{
AddressServiceData _AddressServiceData = new AddressServiceData();
try
{
DataTable _PnPStoresListDataTable = new DataTable();
string address = string.Empty;
int GridRowCounnt = 0;
GridRowCounnt = dgrgPnPStores.RowCount;
for (int i = 0; i < GridRowCounnt; i++)
{
address = dgrgPnPStores.Rows[i].Cells[5].Value.ToString();
_PnPStoresListDataTable = _AddressServiceData.GetGoogleSearch("", address + " South Africa", "", "");
}
}