public void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
var senderGrid = (DataGridView)sender;
MyWebBrowser.Document.InvokeScript("focusToPin", new object[] { senderGrid.Rows[e.RowIndex].Cells[0].Value, senderGrid.Rows[e.RowIndex].Cells[1].Value });
}
public void button1_Click(object sender, EventArgs e)
{
while (true)
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=sistem1.mdb");
using (DataTable dt = new DataTable())
{
conn.Open();
using (OleDbDataAdapter adapter = new OleDbDataAdapter("Select maps_x as X, maps_y as Y, maps_durum as Durum, bina_isim as binaName from sistem2 ", conn))
{
try
{
if (adapter != null)
adapter.Fill(dt);
}
catch
{
continue;
}
}
}
int count = 0;
foreach (DataGridViewRow dtr in dataGridView2.Rows)
{
count++;
var currentCulture = System.Globalization.CultureInfo.InstalledUICulture;
var numberFormat = (System.Globalization.NumberFormatInfo)currentCulture.NumberFormat.Clone();
numberFormat.NumberDecimalSeparator = ".";
double fEnlem;
double fBoylam = 0;
double fisim;
if (count != dataGridView2.Rows.Count)
{
bool succeededE = double.TryParse(dtr.Cells[0].Value.ToString(), System.Globalization.NumberStyles.Any, numberFormat, out fEnlem);
bool succeededF = double.TryParse(dtr.Cells[1].Value.ToString(), System.Globalization.NumberStyles.Any, numberFormat, out fBoylam);
bool succeededG = double.TryParse(dtr.Cells[2].Value.ToString(), System.Globalization.NumberStyles.Any, numberFormat, out fisim);
if (succeededE == true && succeededF == true)
{
if (fEnlem < 91 && fEnlem > -91 && fBoylam < 181 && fBoylam > -181)
dataGridView1.Rows.Add(dtr.Cells[0].Value, dtr.Cells[1].Value, dtr.Cells[2].Value, dtr.Cells[4].Value, dtr.Cells[3].Value);
}
}
}
MyWebBrowser.Document.InvokeScript("changeCenter", new object[] { dataGridView1.Rows[0].Cells[0].Value, dataGridView1.Rows[0].Cells[1].Value });
dataGridView1.Visible = true;
button1.Visible = false;
string color;
for (int i = 0; i < dataGridView1.RowCount; i++)
{
if (dataGridView1.Rows[i].Cells[2].Value.ToString() == "")
color = "Green";
else
color = "Brown";
MyWebBrowser.Document.InvokeScript("updateMapWithPushpins", new object[] { dataGridView1.Rows[i].Cells[0].Value, dataGridView1.Rows[i].Cells[1].Value, dataGridView1.Rows[i].Cells[2].Value, color });
MyWebBrowser.Document.InvokeScript("updateMapWithPushpins", new object[] { dataGridView1.Rows[i].Cells[0].Value, dataGridView1.Rows[i].Cells[1].Value, dataGridView1.Rows[i].Cells[4].Value, Color.Aqua });
}
break;
System.Data.OleDb.OleDbException: 'Belirtilmemiş hata İsteyene Projeyi Atabilririm yoruldum Artık Çözemiyorum'