Question: I HAVE A WINDOWS APPLICATION. in this i have a form on which there is a datagridview.
now i am populating the datagridview with **EMPLOYEE MASTER** in the database. so when the datagrid is populated i also have 2 extra buttons as other 2 cloumns in the datagrid. those are **EDIT & DELETE** now so each row in the datagrid has these buttons. now i want to add proper edit and delete functionality on the click of these buttons. for edit a new form should open. having all the info abt tht particular employee.
please help

here is the code :

```
private void frmemployee_Load(object sender, EventArgs e)
        {
            cmd.Connection = con;
            con.Open();
            adp = new SqlDataAdapter(cmd);
            cmd.CommandText = "Select * from employee";
            adp.Fill(dsemployee,"employee");
            dataGridView1.DataSource = null;
            dataGridView1.Rows.Clear();
            dataGridView1.DataSource = dsemployee.Tables[0];
            dataGridView1.Columns[0].Visible = false;
            DataGridViewButtonColumn editcolumn = new DataGridViewButtonColumn();
            editcolumn.UseColumnTextForButtonValue = true;
            editcolumn.Text = "EDIT";
            editcolumn.Name = "EDIT";
            editcolumn.DataPropertyName = "EDIT";
            editcolumn.HeaderText = "EDIT";
            dataGridView1.Columns.Add(editcolumn);

            cmd.ExecuteNonQuery();
            con.Close();

        }

```

Answer: 
**Update** : Since you now mentioned you want to sore this into a file! You could still set the json into a variable like below, then set it's value. Then use [JSON.stringify()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) to convert it into a string and then write it into your file on the backend. This would really depend on how your system is designed.

---

I'm not sure why but since you have `@` in the keys for your JSON object you will have to get and set them like this:

```
//assign into a variable
var x = {
"@id": "2",
"@samsid": "d7058536c89b46c0b58117eff64372f7",
"@productname": "Another paid for",
"@downloaddate": "2013-05-28 11:37:12Z",
"@downloadlocation":
   "2AFoGZVJpFHzspQD9UoE2C4VFYc8idiO4ebaRx4uEvtG+79DjkOUjJQjp9lJdSk54KIbFqzr",
"@upgradeavailable": "2wECEpVJpFHS",
"@downlaodstatus": "3QGf15VJpFFrUzr6oxwoew=="
};
alert(x["@id"]); //shows 2
x["@id"] = 4
alert(x["@id"]);//shows 4

```

See a working fiddle : <http://jsfiddle.net/jPa6n/>
if you use javascript and some libraries try something like this (I use jQuery as it is popular)

```
var a = JSON.parse('{"@id": "2","@samsid": "d7058536c89b46c0b58117eff64372f7","@productname": "Another paid for","@downloaddate": "2013-05-28 11:37:12Z","@downloadlocation": "2AFoGZVJpFHzspQD9UoE2C4VFYc8idiO4ebaRx4uEvtG+79DjkOUjJQjp9lJdSk54KIbFqzr","@upgradeavailable": "2wECEpVJpFHS","@downlaodstatus": "3QGf15VJpFFrUzr6oxwoew=="}');
a['@id'] = 4;
var b = JSON.stringify(a);

```