i have gride view and i add delete action on it it want when the user press on delete return value in exact cell to save it in another table who can i do this ?
i have this code :
- using (SqlCommand _Cmd_Insert_NewLog = new SqlCommand("INSERT INTO tblLog (UserName,PCName,PCIP,LogDate,Note) VALUES(@UserName,@PCName,@PCIP,@LogDate,@Note)"))
- {
- //------- To Get User Name -----------//
- string _StrUserName = "";
- _StrUserName = Session["EmployeeUserName"].ToString();
- //------- To Get Computer Name -----------//
- string _StrHostName = ""; _StrHostName = Dns.GetHostName();
- //------- To Get IP Address -----------//
- string _StrHostIP = "";
- _StrHostIP = HttpContext.Current.Request.UserHostAddress.ToString();
- string _Str_Note = "The User : " + _StrUserName + " | Delete The Item With Barcode : " + LblBarcode.Text.Trim().ToString() + " | In Date : " + _DateAdd;
- _Cmd_Insert_NewLog.CommandType = CommandType.Text;
- _Cmd_Insert_NewLog.Parameters.AddWithValue("@UserName", _StrUserName);
- _Cmd_Insert_NewLog.Parameters.AddWithValue("@PCName", _StrHostName);
- _Cmd_Insert_NewLog.Parameters.AddWithValue("@PCIP", _StrHostIP);
- _Cmd_Insert_NewLog.Parameters.AddWithValue("@LogDate", DateTime.Parse(_DateAdd));
- _Cmd_Insert_NewLog.Parameters.AddWithValue("@Note", _Str_Note);
- _Cmd_Insert_NewLog.Connection = _Conn;
- //_Conn.Open();
- _Cmd_Insert_NewLog.ExecuteNonQuery();
- _Conn.Close();
- }
LblBarcode.Text.Trim() its label i want to read the barcode from it the barcode in the grideview in cell 4

AbedElHamid AlWahidyPosted Feb 16, 2016, 7:15 AM
LblInfo.Text = cell.Text.ToString();
AbedElHamid AlWahidyPosted Feb 15, 2016, 1:59 AM
{
GridViewRow _First_Row = GridView1.SelectedRow;
string _Select_BarcodeNumber = _First_Row.Cells[4].Text;
LblBarcode.Text = _Select_BarcodeNumber.ToString();
}
Chandu KumawatPosted Feb 14, 2016, 11:56 PM
{string query= "insert into tablename (columnname) values('"+ grdVacancy.SelectedRow.Cells[1].Text+"')";Chandu KumawatPosted Feb 14, 2016, 11:51 PM