Monday, November 16, 2009

Update !!

private void updatecom()
{
//using (SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["MyCartConnKEy"]))
//{
string FileDirectory = Server.MapPath("Database/admin.mdb");
OleDbConnection ocon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileDirectory.ToString() + "");
//OleDbConnection ocon = new OleDbConnection();
try
{
string status = Request.QueryString["setStatus"].ToString();
string id = Request.QueryString["um_id"].ToString();
ocon.Open();
string str = "update Project_master set Project_status='" + status + "' where Project_id=" + id + "";
// SqlCommand updatecom = new SqlCommand(str, scon);
OleDbCommand ocom = new OleDbCommand(str, ocon);
ocom.ExecuteNonQuery();
Response.Redirect("ViewProject.aspx");

}
catch (OleDbException ex)
{
Response.Write(ex.Message.ToString());

}
finally
{
ocon.Close();

}


//}

}

No comments: