I have a class method for updating database.. but it isn't working and I can't find out what is wrong..
There is no error in the try catch block.. in database type of id is int and type of catagory is nvarchar(50).
I also tried converting id from int to string but doesn't work and no error..
Database column name and variable name is same. Connection string is saved in web.config file which worked for inserting data.
public string update(int id, string catagory)
{
        //creating database connection
        SqlConnection objConnection = new SqlConnection(strConnection);
        objConnection.Open();
        string error = "";
        try
        {
            //firing command
            string strCommand = "UPDATE Data SET catagory = '" + catagory + "' WHERE (id = '" + id + "')";
            SqlCommand objCommand = new SqlCommand(strCommand, objConnection);
            objCommand.ExecuteNonQuery();
        }
        catch(System.Data.SqlClient.SqlException ex)
        {
            error = ex.ToString();
        }
        //closing database connection
        objConnection.Close();
        return error;
    }