There is SO much wrong with this code.
wrote:
string str = txttitle.Text;
da = new SqlDataAdapter("SELECT job_id, jobtitle FROM Job_Details WHERE (jobtitle LIKE '" + str + "%')", con);
This code means any user can erase your database, and probably guess how to add users, remove them, etc. Please tell me that your stream of questions relates to something you're writing for fun, and not something anyone is paying for ?
And no, I don't care if you one vote me for giving real advice and telling the truth.
wrote:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
int selectedrow = Convert.ToInt32(GridView1.SelectedRow.Cells[1].Text.ToString());
}
You do a postback whenever the selection changes, or the text changes ? Really ? This code is useless. It can't ever 'work' if by work you mean anything other than 'assign an integer that is never used and move on'. So you store an int called selectedRow. Why do you expect that to do ANYTHING for you ?