There is a code parsing links in the grid and delete the row from the grid(from the base and can't do). But here's the problem, when you press the parsing drops out the window(which I have done(Message) request removal line, and wherein the parsing is not happening. Tell me how can I fix it?
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
/*---Delete rows---*/
if (e.RowIndex != -1)
{
DialogResult result = MessageBox.Show("are you SURE You want to remove the row from the table?",
"Caution. Deleting a row from table", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
switch (result)
{
case DialogResult.Yes:
{
SqlConnection connection = new SqlConnection("server=ROOT-PC\\\\SQLEXPRESS; database=edik; uid=sa; pwd=123321");
connection.Open();
SqlCommand cmdDel = new SqlCommand("DELETE FROM edik_1 WHERE FeedID = @FeedID", connection);
SqlParameter param = new SqlParameter();
param.DbType = DbType.Int32;
param.ParameterName = "@FeedID";
// MessageBox.Show(dataGridView1.CurrentRow.Cells[0].Value.ToString());
//0 is the first cell in the current row of the grid
param.Value = dataGridView1.CurrentRow.Cells[0].Value;
cmdDel.Parameters.Add(param);
byte count = 0;
try
{
count = (byte)cmdDel.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
if ((connection != null))
{
connection.Close();
}
}
if (count > 0)
{
dataGridView1.Rows.RemoveAt(dataGridView1.CurrentRow.Index);
}
if (e.ColumnIndex == 3) dataGridView1.Rows.RemoveAt(e.RowIndex);
else if (e.ColumnIndex == 0)
{
/*---Parsing---*/
XmlTextReader reader = new XmlTextReader((sender as DataGridView)[e.ColumnIndex, e.RowIndex].Value.ToString());
while (reader.Read())
{
switch (reader.Name)
{
case "title":
listBox1.Items.Add(reader.ReadString());
break;
case "link":
listBox1.Items.Add(reader.ReadString());
break;
case "pubDate":
listBox1.Items.Add(reader.ReadString());
listBox1.Items.Add("\");
break;
}
}
}
break;
}
case DialogResult.No:
{
return;
}
}
}
}
Should be like this:

Previously worked, to add some features(which are also needed).
And now, here it is: