Hi,
Can someone help me to correct my code to make my Gidview update.
Here is my code below:
Can someone help me to correct my code to make my Gidview update.
Here is my code below:
Code:
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string unqNo = GridView1.DataKeys[e.RowIndex].Value.ToString();
string salMod = GridView1.Rows[e.RowIndex].Cells[6].Text;
string applGa20 = GridView1.Rows[e.RowIndex].Cells[7].Text;
string updateQuery = string.Format("UPDATE SSU_EMPDETAILS SET SALARY_MODELING = '{0}',APPL_GA20='{1}' WHERE UNIQUE_NO = {3}",salMod,applGa20,unqNo);
GridView1.EditIndex = -1;
BindData(updateQuery);
}
private void BindData(string Query)
{
OracleConnection oCon = new OracleConnection("Data Source=PSM1;User ID=C****DM;Password=C****DM");
OracleCommand oCmd = oCon.CreateCommand();
oCmd.CommandText = "Select * from SSU_EMPDETAILS";
oCmd.CommandType = CommandType.Text;
OracleDataAdapter oDa = new OracleDataAdapter(oCmd);
System.Data.DataSet oDs = new DataSet();
oDa.Fill(oDs);
GridView1.DataSource = oDs;
GridView1.DataBind();
}
Comment